This really simple program is giving weired results it compiles without any errors and runs properly if i don't declare c[10] (which is not used in program anywhere) on Code::Blocks 8.02 and Quincy 2005 (although it does not run properly on Dev C++ with or without declaration of char c[10];)
#include<iostream>
using namespace std;
int main()
{
char c[10]; //if this is kept as comment program will work fine.
char *t;
cin>>t;
cout<<t;
return 0;
}
Well, you are right it is abusing pointers and the result is bound to be unpredictable,Thanx for help.
BTW this link (topic) on forum was really helpful for me http://www.cplusplus.com/forum/beginner/13343/