Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 10-28-2005, 04:30 AM   #1
Beta Member
 
Join Date: Oct 2005
Posts: 3
Default dev c++

hi im new to c++ amd im having some problems.
I have got the dev C++ compiler.
The problem is that i do what the tutorial says in the help menu,

#include <stdin.h>
main()
{
printf("Hello World\n");
}

but when i go and compile it and run it tells me to save which i do what the help says by saving it as 'hello.c' then a box appears then disappears really fast.then nothing happens. but at the bottom when it has all them things like:
compiler,resources and compile log ect. it says that 'stdin.h' is not a directoriy.
i also found out that you can use 'iostream' to go there but it also says there is no such file or directory.

so please can someone help me start off i am so keen nto learn the language i have just finished 'html' and i want to learn this next.
thanks for any help i get marshall
__________________

AliM is offline   Reply With Quote
Old 10-28-2005, 11:53 AM   #2
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: dev c++

Hi, let's go from the top, Ok?

Step 1: Start a new project, name it, select console and make sure it is a C project.

Step 2: Enter the source code as what is shown below exactly.
Code:
 
#include <stdio.h> /*Comment: stdin.h doesn't exist as a standard!*/
#include <stdlib.h>

int main(void)
{
     printf("Hello, World!\n");
     system("pause"); /* Comment: You need this to hold the screen open to 
                                 see its output. */
     return(0); /* Required from main under C */
}
Step 3: Save everything, preferrably in the same directory together.

Step 4: From the Execute menu select Compile and Run. A dialog box should come up, stuff grinds a bit then the program window (a console) should pop
up and display your message and "Press any key to continue...". When you press a key, it should close.

There are a couple of things that could be wrong if the above doesn't work.
The easiest way to fix the most common thing is to click the Tools menu, select Compiler options and click the default button. It should reset all the directory paths to what is normal for the install. Next, if it is still misbehavin', go to the directory dev-cpp\includes and see that there are a lot of .h files hangin' out in there. Then check the dev-cpp\lib for a bunch of .a files. If all that is correct, it should work. Hope this gets it straightened out for you.
__________________

__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Old 10-28-2005, 12:28 PM   #3
Beta Member
 
Join Date: Oct 2005
Posts: 3
Default Re: dev c++

hi yeah thanks for help so far one last thing does it matter wot directory i save it in can i save it in my own folder in my documents
AliM is offline   Reply With Quote
Old 10-29-2005, 11:55 AM   #4
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: dev c++

Yes, but as you make new programs most programmers find it useful to create a new folder per project or tutorial and put things in there. Where you put the source will usually be the default path that the executables are built in and making new directories keeps them accessable and separate. Glad it worked out.
__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:51 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0