One difference between C and C++
It is worth noting that one major difference between C and C++ is the way the code is documented, that is to say that the layout of various items like declaration and initialization as well as the position of the main function is fixed in C.while C++ provides a more flexible approach in the same matter. while coding in c++ you can initialize anywhere in between the code, and declare and define any function keeping in mind just that it is not called before it's declaration. so that is an added benefit on coding in C++.
actually this can be thought of to be a direct consequence of the ability of a C++ code to perform late binding. SO you can call the free store of memory any time you want.
example:
In C the following code is invalid, but valid in C++:
void main( )
{
int a;
clrscr( );
int b;
}
here initialzing the interger 'b' after calling the function clrscr( ) would lead you to an error.
while at the same time, it's a perfect little code in case of C++.
that is why in case of C++ you can write the for loop like this:
for(int i=0; i<10;>
Keep this fact in mind to take your programming skills to a better level.

2 Comments:
I appreciate your blog. I just came from a internet casino craps blog online. And, I actually won a lot of money online! Check this internet casino site. Once you download the secret Casino Winning Software, you will allways win! You will find the special software by clicking on the banner on the right bottom on Goldeninternetcasino.com
One more major difference is the introduction of reference variables in C++
Enjoy C++
-Prashanth
My C++ Blog
Post a Comment
<< Home