Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 08-12-2003, 03:55 PM   #1
Member (5 bit)
 
Join Date: Aug 2003
Posts: 19
CRASH wanted: simple c program

im just starting to program in c and would be grateful if anyone has a very simple c program with the source code, possibly one you made when you were starting, to help me. thanks a lot!
kartman1807 is offline   Reply With Quote
Old 08-12-2003, 03:59 PM   #2
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Typically, the first program you do is a "Hello World" program. Here is one:

Code:
#include

main()
{
    printf("Hello World");


}
There are many C tutorials on the web. Check some out and you will start picking up the language.
doctorgonzo is offline   Reply With Quote
Old 08-12-2003, 04:00 PM   #3
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Typically, the first program you do is a "Hello World" program. Here is one:

Code:
#include <stdio.h>

main()
{
    printf("Hello World");


}
There are many C tutorials on the web. Check some out and you will start picking up the language.

Edit: sorry for the double-post.
doctorgonzo is offline   Reply With Quote
Old 08-12-2003, 05:01 PM   #4
Member (5 bit)
 
Join Date: Aug 2003
Posts: 19
thnx for the advice. iv tried that progarm - as you say its the first natural step. i have a compiler called lcc which came with a tutorial which is handy as obviously the tutorial relates directly to the compiler but it doesnt, if you see what i mean, go through it step by step, it just tells you what different commands do and im having trouble absorbing all the information at once.
so what im really looking for is a fairly simple program, presumably in a dos shell, with the source code so that i can see how the code translates into the finished program.
any further thoughts?
thnx
dan
kartman1807 is offline   Reply With Quote
Old 08-13-2003, 08:07 AM   #5
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
I guess I don't understand what the problem is.

The "Hello World" program is a DOS program. If you compile it to an executable, it will run in a DOS window. Are you having problems compiling the program to an executable?
doctorgonzo is offline   Reply With Quote
Old 08-13-2003, 04:03 PM   #6
Member (5 bit)
 
Join Date: Aug 2003
Posts: 19
no iv got the compiling figured out. i can compile it to an executable and run it from a dos prompt.
the trouble is this program is ultimately pointless and so i want a small simple program that has a bit more of a point than simply printing text on the screen.
thnx for all the advice.
kartman1807 is offline   Reply With Quote
Old 08-13-2003, 04:07 PM   #7
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
In that case, I think you should just follow a tutorial, either online or in a book. They will have more complicated programs with looping, branching, and so forth. One website to check out is http://www.cprogramming.com/
doctorgonzo is offline   Reply With Quote
Old 08-27-2003, 04:41 PM   #8
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
while not exactly simple, this program that i wrote in a C++ class will give you a good idea of what you are going to get into. This is only basic "first year" C++. If you have any questions about it, I can answer it and most people around here can also. I think doctorgonzo helped me a little on this program


^dan
Attached Files
File Type: zip lab5.zip (3.1 KB, 63 views)
GSXdan is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:05 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2