Question
1.
#include
2.
using namespace std;
3.
class Foo
4.
{
5.
public:
6.
Foo(int i = 0){ _i = i;}
7.
void f()
8.
{
9.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
class Foo
4.
{
5.
public:
6.
Foo(int i = 0){ _i = i;}
7.
void f()
8.
{
9.
cout
Answer: Option A
Was this answer helpful ?
In this program, We passes the value to the class and printing it.
Output:
$ g++ ptm4.cpp
$ a.out
Executed
Was this answer helpful ?
Submit Solution