Re: entering more characters
- From: "Barry" <prbharath@xxxxxxxxx>
- Date: 27 Jul 2005 05:15:31 -0700
Why don't u do a bounce check? never get past an array limit
kk wrote:
> Hi all,
>
> in the following code, i enter more characters into a character array.
> array size declared as 80. i enter more characters then i get
> segmentation fault. if anybody knows give me reply.
> thanks in advance.
>
> Regards
> kk
>
>
> main()
> {
> char s[80];
> scanf("%[^\n]s",s);
> printf("%s",s);
> }
.
- Follow-Ups:
- Re: entering more characters
- From: Jack Klein
- Encouraging illegal behavior is O/T in clc (Was: Re: entering more characters)
- From: Kenny McCormack
- Re: entering more characters
- References:
- entering more characters
- From: kk
- entering more characters
- Prev by Date: Re: strcpy and strcat's return type
- Next by Date: Re: entering more characters
- Previous by thread: Re: entering more characters
- Next by thread: Encouraging illegal behavior is O/T in clc (Was: Re: entering more characters)
- Index(es):
Relevant Pages
|
|