Search This Blog

Loading...

Declare a Variable in C++ class

#include<stdio.h>
#include<conio.h>

class demoClass
{
    public:
        string name;    //Declare a name variable in demoClass.
};

void main()
{
    clrscr();

    demoClass obj;
    obj.name="C is world of all Programming Languages.";

    getch();
}

No comments:

Post a Comment