How do you flush a buffer in c++?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C++ General Interview Questions

How come you find out if a linked-list is a cycle or not?

0 Answers  


Program to check whether a word is a sub-string or not of a string typed

0 Answers  


How do you add an element to a set in c++?

0 Answers  


What is a storage class? Mention the storage classes in c++.

0 Answers  


What is size of null class?

6 Answers   HP,






Why do you use the namespace feature?

0 Answers  


Differentiate between a constructor and a method in C++.

0 Answers   Tech Mahindra,


When the design recommends static functions?

2 Answers   Symphony,


What is "map" in STL?

2 Answers  


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?

5 Answers  


What is the this pointer?

0 Answers  


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; }

1 Answers  


Categories