this is to swap to strings....but in output the whole
strings are swapped leaving first as it is...why it is so
#include<iostream.h>
int main()
{
char a[]="ajeet";
char b[]="singh";
long x=*a;
long y=*b;
cout<<x<<":"<<y;
x=x+y;
y=x-y;
x=x-y;
*a=x;
*b=y;
cout<<x<<":"<<y;
cout<<&a<<endl;
cout<<&b<<endl;
}
What is a constructor and how is it called?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
Write about the scope resolution operator?
What are static type checking?
What are smart pointer? Whats its use?
Will the inline function be compiled as the inline function always? Justify.
Why we use #include iostream in c++?
How to declare a pointer to an array of integers?
What you mean by early binding and late binding? How it is related to dynamic binding?
What do you mean by vtable and vptr in c++?
What is a c++ vector?
Does dev c++ support c++ 11?