![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#2 | |
|
Expert Programmer
|
Quote:
Also take a look at Bloodshed Dev-C++ or Code::Blocks.
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
|
#3 |
|
Professional Programmer
![]() Join Date: Sep 2005
Posts: 419
Rep Power: 4
![]() |
>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.
__________________
Even if the voices aren't real, they have some pretty good ideas. |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Sep 2005
Posts: 50
Rep Power: 4
![]() |
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.
|
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3
![]() |
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. |
|
|
|
|
|
#6 | |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
Quote:
What do i do in visual studio to see the output of my program (hello world for example) #include <stdio.h>
int main()
{
printf("\nHello wolrd\n");
return 0;
}if i dont do a scanf or gets() or something like that |
|
|
|
|
|
|
#7 |
|
Professional Programmer
|
#include <stdio.h>
int main()
{
printf("Hello World!\n");
system("pause");
return 0;
}That will show up if you run the .exe by itself.
__________________
The world's first athletic computer geek! The home of PrProgramsStudios How not to post a question: <-- Please don't reply |
|
|
|
|
|
#8 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5
![]() |
more data please, you're using possibly the best IDE ever.
__________________
i put on my robe and wizard hat... Have you ever heard of Plato, Aristotle, Socrates?...Morons. |
|
|
|
|
|
#9 |
|
Hobbyist Programmer
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3
![]() |
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?
|
|
|
|
|
|
#10 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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");
getchar();
return 0;The getchar function gets a character from the user. Usually, we'd use it as follows: char myCharacter; myCharacter = getchar(); 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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|