How can I pass a file into const char*
passing file
Collapse
X
-
In gerneral, you can't.Originally posted by dru103079How can I pass a file into const char*
You can store the name of the file in a char array and pass a pointer to that around, Or maybe you can read the contents of the file into a char array and pass a pointer to that around.
You can also get a FILE * to pass around, it just depends on what your trying to do and how you want to do it. -
Are you in C or C++??
If you are in C++, you can set a const member data value in the intializer list of a constructor. You should able to call a function to read the file and get the value.Comment
Comment