[Courses] [C] Beginner's Lessons: Where are We, What's in Store?

KWMelvin kwmelvin at intrex.net
Sun Oct 13 19:25:08 EST 2002


Greetings,

We've gone fairly rapidly through five beginning C lessons.
My M.O. for these lessons has been to read a chapter, and
take notes.  Then I post my notes to the list.  Hopefully
these notes have been useful for other beginners trying to
learn C.  I've made mistakes along the way, but this community
helps spotting the mistakes, and correcting them. Thanks!  

So, what have we learned, so far?

We got the C compiler up and going.
We learned about /* commenting a program */ and some style
We learned about program clarity and keeping it simple
We know basic program structure: main(){ return 0;}
We learned some simple operators: * / + - %
Variable declarations, naming variables
Integer variable types:  int var_name; /* comment */
Assignment statements:  var_name = expression;
printf() function and integer conversion specifier: "%d"
Floating point variables:  float var_name; /* comment */
Floating point versus integer division
Character variable types:  char var_name; /* comment */
Special characters: \b \f \n \r \t \' \" \\ \nnn
Array declarations:  type array_name[no_elements];
Strings (arrays of characters)
String functions: strcpy() strcat() strcmp()
Coverversion specifiers: "%c" "%s" "%f"
fgets()  sizeof  stdin
Multiple dimensional arrays:  type array_name[size1][size2];
Reading numbers: sscanf() (don't forget the '&')
Initializing variables:  type var_name = expression;
Types of integers and qualifiers: long short signed unsigned
Conversion specifiers: %h  %d  %ld  %H  %u  %lu
Types of floats: float   double
Hexadecimal and Octal constants  0123 (octal)  0xFFFF (hexadecimal)
Shorthand operators: +=  -=  *=  /=  %=
Side effects!
if statement
else statement
while statement
break statement
continue statement
Relational operators: <=  <  >  >=  ==  !=
Assignment anywhere side effects

Have I missed anything?

I've posted useful supplements and addendums, including a handy
ASCII character chart, C keywords, C operators, C library functions,
and answers to the exercises.  I hope all this has been helpful?
It sure has been a helpful review of the basics for me.  I'll be
out of town for a couple of weeks, so that should give everyone
time enough to catch up.  If there is still interest in doing this
when I come back, then we'll continue.  Until then,

Happy [C] Programming!
--
K




More information about the Courses mailing list