How do you flush a buffer in c++?
No Answer is Posted For this Question
Be the First to Post Answer
How come you find out if a linked-list is a cycle or not?
Program to check whether a word is a sub-string or not of a string typed
How do you add an element to a set in c++?
What is a storage class? Mention the storage classes in c++.
What is size of null class?
Why do you use the namespace feature?
Differentiate between a constructor and a method in C++.
When the design recommends static functions?
What is "map" in STL?
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?
What is the this pointer?
this is to swap to strings....but in output the whole strings are swapped leaving first as it is...why it is so #include<iostream.h> int main() { char a[]="ajeet"; char b[]="singh"; long x=*a; long y=*b; cout<<x<<":"<<y; x=x+y; y=x-y; x=x-y; *a=x; *b=y; cout<<x<<":"<<y; cout<<&a<<endl; cout<<&b<<endl; }