Bill Cunningham said:
It's about passing a struct to a function called copi that calls on fread
fwrite. Indirectly fread and fwrite is being used so maybe it is in a away
about those 2 function's first parameter. Which is void *. This is the
generic pointer. That's why I have void *buf in my struct.
include stdio.h
int main(void) {
struct param p;
p.buf= /*Have no idea what to do now */
Now I can give up on this, or bring it to clc for help. I decided to do
that. I don't know how to code a pointer through a struct for differing
types of pointers like void * is for. I guess it doesn't matter in another
post I was told what type of buffer it is but the size of it so I consider
the question answered. But if you have anything to add I'm listening please
do.
I think you missed the point. No one can help if we don't know what the
high-level goal is. Anyone who's guessed what your question means (I
have for example) knows that you should not be trying to do that, but
the right way to do it depends on what the program's high-level goal is.
Imagine this:
Q: I don't know how to alter the return type of a function.
CLC: You can't. What are you trying to do?
Q: I'm trying to alter the return type of a function.
CLC: No, what is the high-level goal?
Q: I want to process input where the data is either a number or a string
like "no data". I've written double get_data(); but I want main to
be able to alter that so get_data returns a char *.
CLC: Ah! You don't do that by "altering the return type". There are
several options...
I know exactly what you want the function to do. But I also know that's
not the right way to do anything in C so it would be pointless my
telling to how to do it. Whatever you program's objective it, there is
a better way than the one you are asking for advice about.