Dinesh,

For an array no need of & as an array without subscripts [] is a pointer
already. Here it is the classical stack corruption.

sai

On Fri, Aug 28, 2009 at 8:48 PM, Dinesh Nidamanuru <[email protected]>wrote:

>  try with "&",,,reference not given in scanf...&key
>
> Its not how you fall, but how you pick yourself up again..** *Regards
> Dinesh.N
> *
>
>
>  ------------------------------
> *From:* mahesh kumar <[email protected]>
> *To:* [email protected]
> *Sent:* Friday, August 28, 2009 2:20:26 PM
> *Subject:* [twincling] c statement
>
> hi
> im working on linux open suse platform
>
> while working with c statement i got a problem
> *
> scanf("%s",key);
>
> error: segmentation fault ( at running time)*
>
> here *key is a character array* declared earlier
>
> plz  plz help me out of this bug
>
> regards
> mahesh  a linux aspirant
>
>

Reply via email to