Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
397 Discussions

What is the code for a default constructor in C++?

AnkitTech
Beginner
184 Views

class construct
{
public:
int a, b;
construct()
{
a = 10;
b = 20;
}
}
int main()
{
construct c;
cout << "a: " << c.a << endl
<< "b: " << c.b;
return 1;
}

0 Kudos
0 Replies
Reply