Every programming course starts with a "Hello World" program - that's a program which does no more than print out the words "Hello World" when you run it - truely minimalist. It's not just convention that courses start that way - it's also very sensible as it allows he tutor to teach the delagates how to edit files, and to get from a file of source code to a runnable program. (Diagram, right - click on it for an enlargement)
For our C course yesterday, I called by "hello world" file greeting.c, and edited the source code in with my favourite text editor. You can see the source code [here]
. I then compiled up the code with gcc to make a runnable file ... which I ran:
gcc -o greeting greeting.c
You'll note that there's more to this in C than in languages line Perl ... in C, you need to add a reference to the header file (to prevent warning messages, anyway!), and you need to define the action within a main
function. I have also chosen to "start them young" by commenting my code. Not strictly necessary, but very much needed once your code starts to grow!
Coding is all about efficiency and code re-use these days ... so I went on to demonstrate the calling of a function in C [here]
and the loading of a function from an included (header) file - see original file [here]
and included file [here]
We offer no less than 4 courses that include C ...
to learning to program in C
. For delegates who are new to programming. Covers C and not C++.
to C Programming
. For delegates with prior programming experience in another language. Covers C and not C++.
to C and C++ Programming
. For delegates with prior programming experience in another language. This course carries on to cover C++ which adds object orientation to C.
to learning to program in C++
. For delegates who are new to programming. This course carries on to cover C++ which adds object orientation to C.
(written 2010-06-30, updated 2010-07-01)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articlesC101 - C and C based languages - Introduction to C 
Learning to Program in C - (2008-12-10) 
Why do we still need C? - (2006-10-03) 
Targetted Advertising - (2005-06-05) 
Choosing a theme - (2005-05-20) 
Programming languages - a comparison - (2005-05-20) 
Training courses in the C language - (2005-05-07)C201 - C and C based languages - C Language Fundamentals 
BODMAS - the order a computer evaluates arithmetic expressions - (2012-11-09) 
Integer types, and integer overflows, in C - (2012-01-25) 
Do I need to initialise variables - programming in C, C++, Perl, PHP, Python, Ruby or Java. - (2011-05-05) 
Your program - you just provide the filling in the sandwich - (2011-04-08) 
Learning to write good programs in C and C++ - separating out repeated code - (2011-01-04) 
What does const mean? C and C++ - (2010-01-15) 
Variables and pointers and references - C and C++ - (2009-01-23) 
Compiling C programs with gcc - an overview - (2008-06-10) 
Turning C from source to a running program - (2006-10-06)
Some other Articles
Catching up with an old friendObjects and Inheritance in C++ - an easy startLearning about Regular Expressions in C through examplesString functions in CStaring a C course with Hello World - why?C Course exercise and sample answer - source in 2 filesJust pass a pointer - do not duplicate the dataSoftware versions used - June 2010Respecting our customers anonimityLorry Parking in Melksham