![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
This tutorial is for beginner programmers who want to learn C. I assume that you do not have any experience programming, just that you know how to navigate your way around windows. If you are an experienced programmer you probably just want to skip this tutorial because I made this more or less for the people who do not know how to program and are asking for tutorials.
To run through this tutorial with me you will probably want to have a c/c++ compiler (either of these would work for c). I would suggest buying visual c++ if you can afford it, but that is pretty expensive so I don’t expect too many people to go out and buy it. There are some pretty good compilers for free on the internet. There is one I particularly like called dev-c++. I've forgotten exactly where you can get that from but if you go to www.zdnet.com you will most likely find it. I also assume you are running Windows and know the basics of it. I have tried to set this up as easy as possible to read. I will make all of the code and other examples I put in this tutorial in code tags to make sure you know when it's code, and when it's actually part of the tutorial. Once you have gotten your c/c++ compiler you can open a new c/c++ source file and clear anything already there. Then copy and paste the following code: #include <stdio.h>
#include <conio.h>
int main(void)
{
printf("hello world");
getche();
return 0;
}Once you have done that the next step is to compile. Each compiler differs a little on how to do this but if you can't figure it out look at the help file along with your compiler. For dev-c++ there is a drop-down menu in between projects and options callled execute. Click on that and you will see a command called compile. If you get errors compiling pm (private message) me and I will see if I can help you out. After you compile go back to the execute drop-down menu and run. It should say: hello world It should create a .exe version of your file where you saved your source code. If all this works you are now set to go.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#2 |
|
Newbie
Join Date: May 2005
Posts: 1
Rep Power: 0
![]() |
xlent code 4 beginners.
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: May 2005
Posts: 34
Rep Power: 0
![]() |
http://www.bloodshed.net/devcpp.html <- best IDE for free (Dev-C++)
|
|
|
|
|
|
#4 | |
|
Newbie
Join Date: Jun 2005
Location: far..far..away
Posts: 25
Rep Power: 0
![]() |
Quote:
|
|
|
|
|
|
|
#5 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Yes, on a Windows machine this would compile. On *nix it wouldn't compile, (with gcc anyway, because conio.h is not installed by default). I however, prefer writing platform independent code, with precompiler directives if needed.
O and Dev-c++ is not the best free. Use VC2005 express beta, free download.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|