Answers for "new declare class c++"

C++
0

c++ classes

class SampleClass
{
    int a;
public:
    SampleClass(int v)
    {
        a=v;
    }
    int RetVal()
    {
        return a;
    }
};
Posted by: Guest on April-12-2021
0

class in c++

class Name {
  private:
  	int data;
  
  public:
  
    // Constructor
  	Name() {
		// Code      
    }
  	int id;
  	void fun1(int a) {
        // Some instructions here 
    }
 	 
}
Posted by: Guest on May-30-2020
-1

create class instance c++

MyClass* MyObject = new MyClass();
Posted by: Guest on March-06-2021

Browse Popular Code Answers by Language