I want to use an array to hold file pointers and another value (most likely the path or name to the file).
[tt]char handles[99][2];[/tt]
How would I be able to store a file pointer and a file path in:
[tt]
handles[handle_name][0] = FILE *fp;
handles[handle_name][1] = "/virtual/path/to/file.dat";
[/tt]
I just came up with a quick example and I don't even know if that works. [tt]handle_name[/tt] can be different "handles" for each two values.
[tt]
struct handles
{
char FILE *fp;
char path[256];
}
struct handles handle_name = { FILE *fp, file_path };
[/tt]
I don't know what to do, I just started learning C.
---------------------------------------
If you helped... thx.
[tt]char handles[99][2];[/tt]
How would I be able to store a file pointer and a file path in:
[tt]
handles[handle_name][0] = FILE *fp;
handles[handle_name][1] = "/virtual/path/to/file.dat";
[/tt]
I just came up with a quick example and I don't even know if that works. [tt]handle_name[/tt] can be different "handles" for each two values.
[tt]
struct handles
{
char FILE *fp;
char path[256];
}
struct handles handle_name = { FILE *fp, file_path };
[/tt]
I don't know what to do, I just started learning C.
---------------------------------------
If you helped... thx.