![]() |
C IDE FOR WIDNOWS --> PLS HELP !!
Hello,
I am desperatly looking for a good c ide for widnows (not linux) . I have Visual Studio, but it is driving me nuts, and doesnt like to show output on the console unless i do a scanf . Any help is much appreciated...ps: i kinda new to C |
Quote:
Also take a look at Bloodshed Dev-C++ or Code::Blocks. |
>doesnt like to show output on the console unless i do a scanf
The who and the what, now? Can you describe your problem in detail for us? It doesn't sound like any common problem I'm familiar with, especially since Visual C++ doesn't have that annoying "close the window when the program ends unless you pause or ask for input" thing going on. |
I think what he means is that if he runs the .exe, he won't see any output unless he's prompting for input, that way the terminal will remain open and not finish so you can see what happens. If you run it in Visual studio though, it will stop and let you view what happens instead of double clicking the .exe alone. Paulchwd, if you use system("pause"); at the end, you'll be able to see your output and the console won't close until you push a button.
|
This code is not guarenteed to show up until your program actually closes:
:
printf( "Hello" );You can use: :
printf( "Hello\n" );If this is your problem, hopefully other people will comment on it. I don't actually know about the different ways to correctly flush the buffer. |
Quote:
What do i do in visual studio to see the output of my program (hello world for example) :
#include <stdio.h>if i dont do a scanf or gets() or something like that |
:
#include <stdio.h>That will show up if you run the .exe by itself. |
more data please, you're using possibly the best IDE ever.
|
You're using a console project right? Does a file names stout.log or printf.log or something like that appear in your project folder?
|
When a console window is finished, it closes. If you don't want it to close, ask it to do something else first. If you don't want it to close until it gets some user input, get some user input:
:
printf("Press the return key to close the window.\n");The getchar function gets a character from the user. Usually, we'd use it as follows: :
char myCharacter;If your code is definitely going to be used only in Windows, you can use the getch function instead of getchar. Whereas getchar waits till the return key is pressed before returning a character, getch will return on the first keypress. You can find it in conio.h. |
| All times are GMT -5. The time now is 7:59 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC