Well, today I had my C++ viva at my school..and I screwed it up!! The answers to this question which I was asked may be easy but I couldn't get it..Few questions of which I haven't got the answers yet--
1.
class A
{ public:
int a;
int b;
};
In the class A there are two public members. If a pointer is created for the object of this class, it will point to first public member of this class. How would I be accessing the next member in the following cases--
1. if the object was static
2. dynamic object
3. normal object
2. How to access any element of two dimensional array using pointers .
3. I was also asked the output for this--
#include<iostream.h>
int main()
{
int a;
a=cin.get();
cout<<a;
return 0;
}
I tried this code but I am not getting the reason behind the output..
It would be great if you could answer these..
Thank you