What is a literal in c++?
No Answer is Posted For this Question
Be the First to Post Answer
What is abstraction in c++?
why is iostream::eof inside a loop condition considered wrong?
How would you use the functions sin(), pow(), sqrt()?
In a function declaration, what does extern mean?
what do you mean by memory management operators
what is data Abstraction
What is null c++?
What are the advantage of using register variables?
When we use Abstract Class and when we use Interface?where we will implement in real time?
Write a function which takes a character array as input and reverses it in place.
2 Answers Lehman Brothers, Vision Infotech,
Difference between declaration and definition of a variable.
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?