# Solved: Dev-c++



## Winged Owl (Nov 15, 2007)

I have recently started learning c and am using the dev-c++ compiler. I am extremely new and am attempting to write the hello world program, here is my source

_#include <stdio.h>

int main(void)
{
(indent here) printf("Hello, world!\n")
(indent here)return 0;
}_

after compiling and linking source code, I was alerted to no errors and nothing wrong with my code, but, alas, when trying to run the .exe, nothing happened, is there something I am forgetting?


----------



## JimmySeal (Sep 25, 2007)

The code looks fine. Are you running the .exe from the command line or from Windows Explorer? If it's the latter, you'll probably only see a black window flash on the screen and disappear.

And just so you know, whitespace doesn't matter in C++, so you don't need to indicate whether or not you indented in certain places.


----------



## Winged Owl (Nov 15, 2007)

alright, thanks, i did see a window flash briefly but couldn't see it, 
and I was using C, and just wanted to be as accurate as possible


----------



## -Fabez- (Jul 28, 2008)

Try adding the code below before the return statement.


```
getchar();
```
It should stop the window from closing immediately after execution. Also when posting code, use the code tag, it will keep the code's formatting, including indents so you do not have to use (indent here) to show indents.


----------

