C++ Viva Questions
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. <a href="https://www.daniweb.com/forums/misc-explaincode.html?TB_iframe=true&height=400&width=680" target="_blank" rel="nofollow noopener noreferrer">DaniWeb-Flavored Markdown Syntax</a>
C++ Syntax (toggle plain text)
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--
______________________________________________________________________________________________
#-Link-Snipped-# | #-Link-Snipped-# | #-Link-Snipped-#
1. <a href="https://www.daniweb.com/forums/misc-explaincode.html?TB_iframe=true&height=400&width=680" target="_blank" rel="nofollow noopener noreferrer">DaniWeb-Flavored Markdown Syntax</a>
C++ Syntax (toggle plain text)
- class A
- { public:
- int a;
- int b;
- };
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--
______________________________________________________________________________________________
#-Link-Snipped-# | #-Link-Snipped-# | #-Link-Snipped-#
0