How to learn a Programming Language
Learning any language freshly,should be started by understanding the format of any language but not by simply cramming the simple programs or its syntax.
So, by here , i would like to help you in learning a programming language in a simple manner and also would like to have your benign suggestion for my knowledge and its presentation.
Starting with C++
Here i am going to start the c++ language assuming to the viewer being very fresh to the language.
A c++ program always have a main function in any program.
So, a learner should always start the program by adding the main function to the program.
--------------------------------------------------------------------------------------------------------
* Always start by the 'main( )' function *
--------------------------------------------------------------------------------------------------------
A 'main( )' function can have two types i.e. 1) 'int' and 2) 'void'. And hence also have the different retrun types with all these types of the 'main( )' function .i.e :
--------------------------------------------------------------------------------------------------------
1) 'int' type will have the return type 'return(0);'
2) 'void' type will have the return type 'getch( )'
So , the format of the 'main( )' and starting of the any program would be as :
------------------------------------------------------------------------------------
* First look of the program *
------------------------------------------------------------------------------------
void main( )
{
---
--- /* Body of the function
--- or program code */
---
getch();
}
OR
int main( )
{
---
--- /* Body of the function
--- or program code */
---
return(0);
}
--------------------------------------------------------------------------------------------
OR

No comments:
Post a Comment