Re: char * and char []

From: Vaggelis Blathras (
Date: 11/30/95

> char command[MAX_INPUT_LENGTH]
> char *cmdd;
> sprintf(cmdd, "%s", command) it crashes the first time I try to use the cmdd
> variable in any way.

Do you alloc any memory to cmdd , with a chmdd=malloc(..) ..? 
If not, cmdd is not properly allocated and so it may produce all kinds of 
SegV errors.

This archive was generated by hypermail 2b30 : 12/07/00 PST