input function question
gsechan at hotmail.com
Sat Jun 5 18:59:36 PDT 2004
>From: Cory Petkovsek <cory at adaptableit.com>
>You are right, I miswrote. It is printf and friends that will segfault (on
>some platforms in some cases) if given an improper mix of tokens and
>variables. (ie printf("%d %d\n", a); ) On other platforms and in other
>it will just print invalid goo. On my solaris box with gcc and a tiny
>it printed this: 3 -13376040. I have seen printf segfault in similar
>compiled with gcc.
You can get scanf to segfault like that if you go scanf("%d %d\n",&a)
without a storage place for the second variable. In fact, its FAR more
likely to segfault than printf.
Is your PC infected? Get a FREE online computer virus scan from McAfee®
More information about the KPLUG-List