Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

will compile but not run

Status
Not open for further replies.

jthacker70

Technical User
Jul 8, 2003
9
0
0
US
Hey.. I have a problem and I am not sure what is going on. Hope it isn’t a silly question, but right now I have Borland C++ version 6 and am running XP none of my programs will run. If I have a program compiled and run it, nothing happens. The program will compile fine. But nothing happens when I execute it. The hello world program will not display hello world. An output window does not even open. I have tried other compilers, C++ and C, and all of them give similar results. On some of the compilers the output screen will flash then disappear. I am completely lost on this topic. I need a compiler on my computer so I can write my programs for class.... ANY suggestions or help will be greatly appreciated.
 
Oh yea.. I tried to input a value (cin>>x;) and it does not work either..
 
Do i understood you right: You has a "ordinary" C-compiler, not the Builder version?

And Your .EXE-file don't do anything when double-clicked?

Try to create a file with at specific name which does not crashes anything (something like "Testing.XXX") and close it. If this file creates....well, it runs!

Streams....isn't that a visual-thing???? I've never been friends with them....

Try x=GetChar() in stead, that's "good old-fasioned DOS"!

Totte
Keep making it perfect and it will end up broken.
 
Totte:

Streams are Standard C++, not a Visual C++ extension.

GetChar(), on the other hand, is non-Standard, and thus not guaranteed to be supported in every library implementation.


jthacher70:

Have you tried running the executables from on the command line?

That is, go to "Run Command" from the Start menu, type [tt]cmd[/tt], then use [tt]cd[/tt] (change directory) to navigate to where the executable is located, then type its name at the command prompt.
 
chipperMDW:
OK, i meant 'getchar()' which, according to "C: A reference manual" (ISBN 0-13-109802-0) is ANSI C standart and equals 'getc(stdin)' and is defined in "stdio.h".

By that the streams are already defined as ANSI C by the (stdin) so, Yes, the streams are standart C (ANSI).

Totte
Keep making it perfect and it will end up broken.
 
Ok, yes, getchar all lower-case is Standard. Sorry for the misunderstanding.

There are also two types of Standard streams: the C FILE* streams (like stdin and stdout), and the C++ iostreams (like cin and cout, used by the original poster).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top