Quote:
Originally Posted by Pat McCarthy
That made that error go away but I still don't really understand how to use the function.
The first line:
char * buffer = new char[10];
is confusing me.
|
The use of the "new" operator is C++ speak, not C speak.
char buffer[10]; /* bigger than 10 is a good idea */
If a static or automatic array (depending on the location
of the declaration) is good enough, or
char *buffer;
buffer = malloc(10); /* again, bigger than 10 is a good idea */
to allocate the storage using the heap allocator in C.
Eugene