C++ Programming and Technical Programming Definition

Q. What is the difference between char a[] = “string”; and char *p =
“string”;?
In the first case 6 bytes are allocated to the variable a which is fixed,
where as in the second case if *p is assigned to some other value the
allocate memory can change.
What’s the

Read Solution (Total 1)

C++ Other Question

What is the difference between the functions memmove() and
memcpy()?
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();
}