From: James Kuyper on 17 Sep 2009 21:07 WANG Cong wrote: > On 09/12/09 20:23, Ramon F Herrera <ramon(a)conexus.net> wrote: > >> I have looked all over the net for this, but all the hits I get are >> about cout, cin or streams linked to disk files. >> >> The feature that I need is in-core (boy, that's an ancient term) >> streams and buffers. >> >> Back when I was a C programmer, I implemented my own streaming like >> this: >> >> char output_buffer[150 *1024]; >> char pointer = *output_buffer; >> >> pointer += sprintf(pointer, "text here %s\n", somevar1); >> pointer += sprintf(pointer, "more text here %s\n", somevar2); >> pointer += sprintf(pointer, "further stuff here %s\n", variable3); > > What? > > 'pointer' is a char, you use it both as a char* and int. I presume he meant "char*".
|
Pages: 1 Prev: [Help needed] Locking mechanisms in Linux Next: broken pipe when reading and writing a pipe |