title: const char* not passing full filename
body: <p>I know there are a lot of questions similar to this, but I don't know of any that are the same, so here's my issue:</p>
  
  <p>I'm trying to pass a filename as a const char * to my ifstream to read and load.</p>
  
  <p>BUT: When I pass the filename, instead of reading the whole string "map.obj"; it just reads the first character "m" and as a result, the ifstream fails.</p>
  
  <p>I don't know what I'm doing wrong and would appreciate a little help. My code follows:</p>
  
  <pre><code>#include &lt;fstream&gt;
  using namespace std;
  
  void loadModel(const char* filename);
  
  int main()
  {
      // Creates and positions the four boxes on the screen. Temporary.
      //rotation r = {0.0f, 0.0f, 0.0f};
      const char* filename = "map.obj";
      loadModel(filename);
      return 0;
      /*meshMgr.addObject(new Object());
  
      position p = {0.f, 10.f, 10.f};
      meshMgr.addObject(new Object(p, r));
  
      p.y = 0.f;
      p.z = 20.f;
      meshMgr.addObject(new Object(p, r));
  
      p.y = -10.f;
      p.z = 10.f;
      meshMgr.addObject(new Object(p, r));*/
  }
  
  void loadModel(const char* filename)
  {
      ifstream in(filename, ios::in); //Open the model file
      if (in.is_open())   //if not opened, exit with -1
      {
          //Set up an array to act as a buffer for text read from the input file
          char buf[256];
  
          //Read input file text to end of file and push onto lines list
          while (!in.eof())
          {
              in.getline(buf, 256);
              //lines.push_back(new std::string(buf));
          }
  
          in.close();
      }
  }
  </code></pre>
  
  <p>EDIT: Before anyone asks, yes the file is being referenced as a local file (do I need to use absolute paths or something?) and exists in the same directory as the source code</p>