I'd like to apologize for my poor english, for it is not my native language
So, here's my question. Is there any way, in C language, to read from my stdout, and to turn whatever I read into a *char
? I can only use functions read, write, malloc and free.
My actual code looks like this
char* acquire_shape()
{
char *buffer[BUF_SIZE + 1];
int ret;
ret = read(0, buffer, BUF_SIZE)
buffer[ret] = '\0';
return *buffer;
}
but I can't get it into a character string.