intoduction:
1. Instructions for use:- This tutorial is for those people who want to learn programming in C++ and do not necessarily have any previous knowledge of other programming languages. Of course any knowledge of other programming languages or any general computer skill can be useful to better understand this tutorial, although it is not essential.
2. Basic of C++:-
a. Structure of a program:
// my first program in C++
#include<stdio.h>
#include<conio.h>
void main{
printf("hello! everycody ....");
}
this is the basic structure of printing sentence.
eg; hello! everybody....
b.header files:
#include<stdio.h>
#include<conio.h>
#include <iostream> etc,.
c. Variables,data types:
The whole process that you have just done with your mental memory is a simile of what a computer can do with two variables. The same process can be expressed in C++ with the following instruction set:
1 2 3 4 |
|
Obviously, this is a very simple example since we have only used two small integer values, but consider that your computer can store millions of numbers like these at the same time and conduct sophisticated mathematical operations with them.
Therefore, we can define a variable as a portion of memory to store a determined value.
Each variable needs an identifier that distinguishes it from the others. For example, in the previous code the variable identifiers were
a
, b
and result
, but we could have called the variables any names we wanted to invent, as long as they were valid identifiers.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment