User:Vinothcse123/sandbox

zssdfds

1.	creating the object without new: myclass obj; This creates the object for the myclass. This is similar to initializing the variable (int a;). Here myclass is the type name and obj is variable. This is static storage duration and uses the stack memory. Here the scope of the variable obj expired at the end of the block.

2.	creating the pointer to class: myclass *obj; This is the pointer to class. i.e., we have created obj Pointer to myclass. you can initialize the obj in two ways Method 1: