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

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

AnkitTech
Beginner
310 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