1,650 views
1 votes
1 votes
Assume that an integer and a pointer each takes 4 bytes. Also assume there is no alignment in objects. Predict the output
#include <iostream>
using namespace std;
class Test{
static int x;
int *ptr;
int y;
};
int main() {
// your code goes here
Test t;
int a;
cout<<sizeof(t)<<"\n";
cout<<sizeof(Test *);

return 0;
}

1 Answer

Related questions

0 votes
0 votes
0 answers
1
debayan1014 asked Feb 12
190 views
How to prepare for IIIT-H PGEE Mtech Exam and Interview?Does they have any criteria of shorlisting Resume for the Interview?
1 votes
1 votes
0 answers
2
shraddha priya asked May 18, 2019
1,092 views
Why does OS and DBMS have their own synchronisation mechanisms, when OS can alone do it and it sits at the bottom of DB?
3 votes
3 votes
4 answers
3
manikgupta123 asked Apr 29, 2019
1,766 views
What is the time complexity to delete an arbitrary node from binary heap?O(n)O(log n)O(1)O(n log n)
3 votes
3 votes
4 answers
4
manikgupta123 asked Apr 28, 2019
1,659 views
What is the time complexity for insertion in binary tree in worst case?O(1)O(log n)O(n)O(n log n)