Crack Query - Leadership Interview
Home
Google - Engineering Manager Interview Prep
System Design Preparation
Design Patterns
Object Oriented Designing
Thursday, 22 March 2012
Union can not participate in Inheritance
#include<iostream.h>
class A{
public:
int a;
};
//struct B:public A
union B:public A
{
void dis()
{
cout<<a<<endl;
}
};
int main()
{
B a;
a.dis();
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
AWS Data Pipeline Services
https://www.youtube.com/watch?v=tykcCf-Zz1M
Maximum of a Tree
Here is the simple code for finding the maximum of a BST: /* Tree Maximum */ Tree* maxTree(struct Tree *node) { while(node->right) nod...
Tree Operations
#include<iostream.h> #include<conio.h> #include<stdlib.h> class Node{ public: Node* left; Node* right; in...
Max Contigous subsequence sum
Given n numbers, find out i and j where 1<=i<=j<=n, where the sumof elements from i to j is maximum. All positive : Sum of all ele...
No comments:
Post a Comment