Electronic Guide
for Engineers

Programming - C for newbies

Sep 9, 2007 by Ale

This site section is for put the C programming basis. It's a very small guide for most important instructions and syntax, but not most comprehensive.

The first tool you must have is a complier; with a search engine you can find a large number of free compilers.

Page summary:

  • "main" statement
  • variables and constants
  • data types
  • assignments and definitions
  • flow control
  • functions
  • built-in functions
  • file management
  • dynamic memory allocation

"main" statement

A C program is always composed by one "main" function, that's the first instructions group executed. example:

#include <stdio.h>
void main(){
    int number,sum;
    sum=0;
    scanf("%d",&number);
    while(number!=0){
        sum=sum+number;
        scanf("%d",&number);
    }
}

 

Last revision: September 9, 2007