Hello, I've been programming in C for just under 3 days, and I have next to no idea what I'm doing. I'm writing a method which gets passed (among other things) void *buf.
I have a character array which i have declared
where len is an unsigned integer. How do I set it up so that buf points to temp?
is it as simple as writing
This was the first thing I tried, and I got no errors, but when I run the program to call the method, which prints the contents of buf, I get no output, which suggests to me this is wrong.
Then I though that I would try something like
but I get
"incompatible types when assigning to type ‘char *[(unsigned int)(len)]’ from type ‘char *’"
All I want to do is write an array wherever buf points to! Surely it shouldn't be complicated...please help me!