Subj : Re: General Protection Fault To : borland.public.cpp.borlandcpp From : Todd Burch Date : Sun Jan 23 2005 02:40 pm "Ed Mulroy [TeamB]" wrote: >Use a function which will respect the size of the buffer. While you are at >it change the return type of main to int so the code is be legal C/C++. > >#include > >int main() > { > char name[50]; > printf("Hello World!\n"); > printf("Enter your name...\n") ; > fgets(name, sizeof(name), stdin); > printf("Hello %s\n",name) ; > return 0; > } > >. Ed > Ed, thanks. Works perfectly now. Now, on to bigger and better challenges. .