Thnx for ur reply. But I would like to know why is the STL cout is behaving like this? Is it a bug in STL? "void (*p[10]) (void (*)());"
Rejeesh
Posts
-
cout<< -
cout<<In the below given program, 'cout' in the destructor doesn't work. But if the iostream is replaced with iostream.h and the statement using namespace std; is commented then, it works fine and displays - "Hello how are you?" Can anyone explain why is it so? #include iostream using namespace std; struct A { A(){cout<<"Hello";} ~A(){cout<<" you?";} }a; void main( void ) { cout<<" how are"; } //"void (*p[10]) (void (*)());"
-
Why??#include #include void main() { char *pstr = new char[5]; strcpy(pstr,"test"); cout<< strrev(pstr) <
-
Beginner's Question IIint GCD(int x, int y) { //Swap if x < y if(x < y) { int t = x; x = y; y = t; } while(x%y) { int r = x%y; x =y; y = r; } return y; } void (*p[10]) (void (*)());
-
Beginner's Questionint GCD(int x, int y) { //Swap if x < y if(x < y) { int t = x; x = y; y = t; } while(x%y) { int r = x%y; x =y; y = r; } return y; } void (*p[10]) (void (*)());
-
Beginner's QuestionIf the code u have written is available, it would be easy to check why is it giving wrong output.:-O void (*p[10]) (void (*)());
-
Confusing codeThank u very much. Its only after ur reply I am thinking that C* C; is not a pointer declaration. Now, everything is quite clear and very simple. Thank u once again. :-O void (*p[10]) (void (*)());
-
Confusing code#include using namespace std; struct C; struct D { void operator*(D) { cout << "one\n"; } } C; struct E { void operator*(E) { cout << "two\n"; } } F; struct F; int main(){ C* C; F* F; return 0; } I got the above code from a C++ site. This code prints "one" "two" on the screen. Can anybody explain why is it printing so? :confused: :confused: :confused: void (*p[10]) (void (*)());
-
What's wrong here??? Pointer questionThe correct code is as follows. int *pPtr; pPtr = new int[10]; //U were allocating for only a single integer for (int i=0; i<10; i++)//u were doing 11 iterations 0 to 10 { *(pPtr+i) = i; } delete[] pPtr; //u were deleting only a single element :) void (*p[10]) (void (*)());