|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (5 bit)
Join Date: Aug 2003
Posts: 19
|
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!
|
|
|
|
|
|
#2 |
|
Professional gadfly
|
Typically, the first program you do is a "Hello World" program. Here is one:
Code:
#include |
|
|
|
|
|
#3 |
|
Professional gadfly
|
Typically, the first program you do is a "Hello World" program. Here is one:
Code:
#include <stdio.h>
main()
{
printf("Hello World");
}
Edit: sorry for the double-post. |
|
|
|
|
|
#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 |
|
|
|
|
|
#5 |
|
Professional gadfly
|
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? |
|
|
|
|
|
#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. |
|
|
|
|
|
#7 |
|
Professional gadfly
|
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/
|
|
|
|
|
|
#8 |
|
Member (10 bit)
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|