After getting the basic difference between syntax of C and C++ we can develop almost all C programs in C++ also. C++ also support same conditional statements, loops and the logic for the code.
Here is the list of C programs that can be developed in C++ also with minor changes in syntax as I described in my last post.
Basic C Programs.
Now we will take a look at new concepts introduced in C++ :
Class
Before reading concept of class you should have basic idea of Structure in C.
Structure allows us to store different data types at one place.
Class also follow the same concept but it is advanced so it enables user to define function with data members. Means user can define different data members in a class as we do in structure and user can also define functions based on those data members.
Object
Object is a run time entity. Object is a variable of a class, that allows user to access class data members and functions.
It is also known as Instance.
A program to understand class and object concept:
Here is the list of C programs that can be developed in C++ also with minor changes in syntax as I described in my last post.
Basic C Programs.
Now we will take a look at new concepts introduced in C++ :
Class
Before reading concept of class you should have basic idea of Structure in C.
Structure allows us to store different data types at one place.
Class also follow the same concept but it is advanced so it enables user to define function with data members. Means user can define different data members in a class as we do in structure and user can also define functions based on those data members.
Object
Object is a run time entity. Object is a variable of a class, that allows user to access class data members and functions.
It is also known as Instance.
A program to understand class and object concept:
0 comments:
Post a Comment