Re: entering more characters
- From: "Suman" <skarpio@xxxxxxxxx>
- Date: 27 Jul 2005 05:07:10 -0700
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.
Are you entering more than 80 characters?
Writing past array bounds is your problem.
> thanks in advance.
>
> Regards
> kk
>
>
> main()
> {
> char s[80];
> scanf("%[^\n]s",s);
> printf("%s",s);
> }
.
- Follow-Ups:
- Re: entering more characters
- From: Suman
- Re: entering more characters
- References:
- entering more characters
- From: kk
- entering more characters
- Prev by Date: entering more characters
- Next by Date: Re: strcpy and strcat's return type
- Previous by thread: entering more characters
- Next by thread: Re: entering more characters
- Index(es):
Relevant Pages
|