What is encapsulation in C++? Give an example.
No Answer is Posted For this Question
Be the First to Post Answer
what is the size of this class class size { public: char data1; double d; int data2; char data3; double data4; short data5; }; please explain the padding for these double variables.
Explain what are single and multiple inheritances in c++?
What are c++ stream classes?
What is lambda in c++?
What is overloading unary operator?
How can I improve my c++ skills?
How static variables and local variablesare similar and dissimilar?
5. Can inline functions have a recursion?
What is the purpose of decltype?
Explain what are the sizes and ranges of the basic c++ data types?
1)#include <iostream.h> int main() { int *a, *savea, i; savea = a = (int *) malloc(4 * sizeof(int)); for (i=0; i<4; i++) *a++ = 10 * i; for (i=0; i<4; i++) { printf("%d\n", *savea); savea += sizeof(int); } return 0; } 2)#include <iostream.h> int main() { int *a, *savea, i; savea = a = (int *) malloc(4 * sizeof(int)); for (i=0; i<4; i++) *a++ = 10 * i; for (i=0; i<4; i++) { printf("%d\n", *savea); savea ++; } return 0; } The output of this two programs will be different why?
Define virtual constructor.