Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
806 Discussions

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

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