I'm making program that asks user to enter some string. I use char *string;
gets(string);
I' m wondering if this is a good way to get string from user and if there is possibility that user enter string so big to overwrite some other later data in my program and cause run-time error, because string is pointer to first byte of data.
one of the possible solution is
char string[80];
this will force compiler to set aside memory but then I'll have fixed size of string.
Thank you



LinkBack URL
About LinkBacks


