C++ Programming and Technical Programming Program

Generate random number

Read Solution (Total 3)

C++ Other Question

What will be the output for the following C++ program ..??

class Sample
{
public:
int *ptr;
Sample(int i)
{
ptr = new int(i);
}
~Sample()
{
delete ptr;
}
void PrintVal()
{
cout << "The value is " << *ptr;
}
};
void SomeFunc(Sample x)
{
cout << "Say i am in someFunc " << endl;
}
int main()
{
Sample s1= 10;
SomeFunc(s1);
s1.PrintVal();
}
What do you mean by internal linking and external linking in c++?