|
|
#1 (permalink) |
|
Platinum Member
![]() Join Date: Jun 2006
Location: Canada
Age: 18
Posts: 588
|
alright so heres the deal im interested in learning to program
-ive chosen my compiler -ive found some tutorials (very basic) and im sure everyone knw the most commmon program is "Hello World" the compiler porgram i am using is Dev-C++ and this is what it looks like (same as tutorials) #include <stdio.h> int main() { printf("Hello World\n"); return 0; } few questions 1 how do i run this program, ive compiled it and when i go to run it a black box pops up and closes 2. IS the very first line neccessary help appreciated this is somthing i am interested in thanks in advance |
|
|
|
|
|
#3 (permalink) |
|
New Member
![]() Join Date: Nov 2006
Posts: 1
|
I see you're learning C, my favorite language by far
. Although C may be extremely difficult to learn if you are new to programming, once you have the basic concepts mastered you'll be good to go since C is not a very "big" language. The easiest way to make this program behave the way you want it to (on a Windows platform) would be to add the getchar() function right before the return statement in main. So it would look something like this: Code:
#include <stdio.h> /* "includes" the standard library */
int main(void)
{
printf("Hello World\n");
getchar(); /* waits for the user to press the enter key */
return 0; /* exits the program */
}
Code:
#include <stdio.h> I recommend that you pick up a copy of The Second Edition of The C Programming Language (ANSI C) by Brian W. Kernighan and Dennis M. Ritchie. Ritchie was the original developer of C and this book is basically the bible for the language. It's geared more toward existing programmers, but still can be easily understood by a beginner. My first programming language was C so if I can do it, anyone can .
__________________
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming newbie wanting advice ^^ | Yoonsi | General Software | 1 | 10-23-2006 11:35 AM |
| anyone whos done/doing programming | Livzz | General Software | 1 | 08-07-2006 11:13 AM |
| Learning Programming ? | zenhawx | General Software | 5 | 06-26-2006 06:51 AM |
| Programming | Diddy | General Computer Chat | 16 | 05-22-2006 12:12 AM |
| Programming on Mac? | Rexhasta | General Computer Chat | 5 | 12-01-2005 02:25 PM |