consider the code
#include int main(void) { char* a; scanf(\"%s\",a);//&a and &a[0] give same results-crashes printf(\"%s\",
You have to allocate memory for a with malloc() before using it .
a
malloc()