I’m using the read function to take in one character, then running the read function again. Before I run the function again, I want to save what’s in the buffer to a char variable. Like this:
void *buf;
read(0,buf,1);
char tempChar;
I want to store what’s in *buf into the char tempChar. I know I can’t just set them equal, but is this possible at all?
Thanks.
You can do it like this:
So there’s actually no need to have a separate buffer at all.