passing file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dru103079
    New Member
    • May 2007
    • 9

    #1

    passing file

    How can I pass a file into const char*
  • mac11
    Contributor
    • Apr 2007
    • 256

    #2
    Originally posted by dru103079
    How can I pass a file into const char*
    In gerneral, you can't.

    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.

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      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

      Working...