Subj : General Protection Fault To : borland.public.cpp.borlandcpp From : Todd Burch Date : Sun Jan 23 2005 05:15 am I can cause a general protection fault quite easily, and I know exactly why, but I don't know the correct technique to prevent getting one. Here is the code: #include void main() { char name[50] ; printf("Hello World!\n"); printf("Enter your name...\n") ; gets(name); printf("Hello %s\n",name) ; } When I enter a name quite a bit longer than 50 bytes, I get the fault. How does one code in C/C++ to make sure this is not allowed to happen? I suspect it comes down to working with pointers... and using a lower level interface than gets(). Thanks, Todd .