On Sun, Jun 8, 2008 at 4:29 AM, John Matthews <[EMAIL PROTECTED]> wrote: > --- In [email protected], "Brett McCoy" <[EMAIL PROTECTED]> wrote: >> >> you need to allocate memory for char >> *input. And as I said before, buf[] is unnecessary. Create a #define >> like BUFSZ 10 and use that to allocate the memory using malloc, and >> remember your buffer needs to be BUFSZ + 1 to hold the terminating >> '\0'. > > Just wondering why you need to use malloc()? Eg.
You don't need top use malloc() if you create an array, of course, but he was using a pointer and failed to allocate memory for it, so I was addressing that. -- Brett ------------------------------------------------------------ "In the rhythm of music a secret is hidden; If I were to divulge it, it would overturn the world." -- Jelaleddin Rumi
