Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 26th, 2004, 3:29 PM   #1
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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.
__________________
&quot;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.&quot; - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old May 30th, 2005, 10:46 AM   #2
sandipan saha
Newbie
 
Join Date: May 2005
Posts: 1
Rep Power: 0 sandipan saha is on a distinguished road
xlent code 4 beginners.
sandipan saha is offline   Reply With Quote
Old May 31st, 2005, 1:09 AM   #3
Chris Weimer
Programmer
 
Join Date: May 2005
Posts: 34
Rep Power: 0 Chris Weimer is on a distinguished road
http://www.bloodshed.net/devcpp.html <- best IDE for free (Dev-C++)
Chris Weimer is offline   Reply With Quote
Old Jul 3rd, 2005, 1:02 PM   #4
clearbit
Newbie
 
clearbit's Avatar
 
Join Date: Jun 2005
Location: far..far..away
Posts: 25
Rep Power: 0 clearbit is on a distinguished road
Quote:
Originally Posted by Chris Weimer
http://www.bloodshed.net/devcpp.html <- best IDE for free (Dev-C++)
ahh yes what i use on my Windows OS, and have been for quite some time.
clearbit is offline   Reply With Quote
Old Jul 3rd, 2005, 1:34 PM   #5
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
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
nnxion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:05 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC