Explain stack & heap objects?
No Answer is Posted For this Question
Be the First to Post Answer
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?
How do you clear a buffer in c++?
What is lambda in c++?
What is the purpose of templates in c++?
Is it possible to write a c++ template to check for a function's existence?
What is ostream in c++?
Why is c++ still popular?
Can a new be used in place of old mallocq? If yes, why?
Explain the uses of static class data?
How would perform Pattern Matching in C++?
What are c++ manipulators?
program to print this triangle * * * * * *