25-06-2012, 01:32 PM
Programming in C in 7 days
Programming in C in 7 days.pdf (Size: 736.71 KB / Downloads: 162)
Quick Start with C
programming language is perhaps the most popular programming language. C was created in 1972 by
Dennis Ritchie at the Bell Labs in USA as a part of UNIX operating system. C was also used to
develop some parts of this operating system. From that time C programming language has been the
de facto programming language when fast programs are needed or the software needs to interact
with the hardware in some way. Most of the operating systems like Linux, Windows™, and Mac™ are either
developed in C language or use this language for most parts of the operating system and the tools coming
with it.
This course is a quick course on C Programming language. In our first lesson we will first write our first
C program. We will then learn about printing to screen, variables and functions. We assume that you are
familiar with at least one of the popular operating systems.
Compiling and Running under Windows with Dev-CPP
To develop, compile and run the program in Bloodshed environment follow below steps. If you have
problem working with your compiler you may ask your problem in our support forums.
1- Run bloodshed and select “New -> Project” from File menu. In the appeared window enter a name
for your project (Figure 1.1). Also select “Console Application”, “C Project” and “Make default
Language” as the settings of your application.
Data Types and Variables
C uses several data types of data. These include characters, integer numbers and float numbers. In C
language you must declare a variable before you can use it. By declaring a variable to be an integer or a
character for example will let computer to allocate memory space for storing and interpreting data
properly.
Naming a variable
It is better that you use meaningful names for your variables even if this causes them to become long
names. Also take this in mind that C is case sensitive. A variable named "COUNTER" is different from
a variable named "counter".
Functions and commands are all case sensitive in C Programming language. You can use letters, digits
and underscore _ character to make your variable names. Variable names can be up to 31 characters in
ANSI C language.
Getting input, Arrays, Character
Strings and Preprocessors
n previous lesson you learned about variables and printing output results on computer console. This
lesson discusses more about variables and adds important concepts on array of variables, strings of
characters and preprocessor commands. We will also learn more on getting input values from console
and printing output results after performing required calculations and processes. After this lesson you
should be able to develop programs which get input data from user, do simple calculations and print the
results on the output screen.
Programming in C in 7 days.pdf (Size: 736.71 KB / Downloads: 162)
Quick Start with C
programming language is perhaps the most popular programming language. C was created in 1972 by
Dennis Ritchie at the Bell Labs in USA as a part of UNIX operating system. C was also used to
develop some parts of this operating system. From that time C programming language has been the
de facto programming language when fast programs are needed or the software needs to interact
with the hardware in some way. Most of the operating systems like Linux, Windows™, and Mac™ are either
developed in C language or use this language for most parts of the operating system and the tools coming
with it.
This course is a quick course on C Programming language. In our first lesson we will first write our first
C program. We will then learn about printing to screen, variables and functions. We assume that you are
familiar with at least one of the popular operating systems.
Compiling and Running under Windows with Dev-CPP
To develop, compile and run the program in Bloodshed environment follow below steps. If you have
problem working with your compiler you may ask your problem in our support forums.
1- Run bloodshed and select “New -> Project” from File menu. In the appeared window enter a name
for your project (Figure 1.1). Also select “Console Application”, “C Project” and “Make default
Language” as the settings of your application.
Data Types and Variables
C uses several data types of data. These include characters, integer numbers and float numbers. In C
language you must declare a variable before you can use it. By declaring a variable to be an integer or a
character for example will let computer to allocate memory space for storing and interpreting data
properly.
Naming a variable
It is better that you use meaningful names for your variables even if this causes them to become long
names. Also take this in mind that C is case sensitive. A variable named "COUNTER" is different from
a variable named "counter".
Functions and commands are all case sensitive in C Programming language. You can use letters, digits
and underscore _ character to make your variable names. Variable names can be up to 31 characters in
ANSI C language.
Getting input, Arrays, Character
Strings and Preprocessors
n previous lesson you learned about variables and printing output results on computer console. This
lesson discusses more about variables and adds important concepts on array of variables, strings of
characters and preprocessor commands. We will also learn more on getting input values from console
and printing output results after performing required calculations and processes. After this lesson you
should be able to develop programs which get input data from user, do simple calculations and print the
results on the output screen.