Hello everyone,
I have just started programming in Linux.I tried this basic program :
This gives a segmentation fault in Linux but it runs perfectly on Borland C++ in Windows.Code:#include<stdio.h> int main() { char *buffer; scanf("%s",buffer); printf("\n%s\n",buffer); return 0; }
How can I avoid this problem?