Help...

Conor P. Cahill cpcahil at virtech.UUCP
Tue Oct 10 21:50:25 AEST 1989


In article <731 at carroll1.UUCP>, dnewton at carroll1.UUCP (Dave 'Yes, I'm weird' Newton) writes:
> main ()
> {
>    char      h[];
		^^
You need to specify the size of the array.  Otherwise your scanf will overwrite
other data on the stack and usualy will cause a core dump.

>    scanf ("%s", h);
>    printf ("%s\n", h);
> }



-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.lang.c mailing list