J
JoeC
I am writing a program and I would like to load a graphic file to a
constructor. The graphic stuff shouldn't matter, I want to pass a file
name to a constructor and create an object with the data in a
particular file so far I have:
graphic::graphic(std::string n){
std::ifstream fin("graphic.txt"); <-- I want to pass a string then
load that data into an object.
std::ifstream fin(n); <-- How can I make this work?
constructor. The graphic stuff shouldn't matter, I want to pass a file
name to a constructor and create an object with the data in a
particular file so far I have:
graphic::graphic(std::string n){
std::ifstream fin("graphic.txt"); <-- I want to pass a string then
load that data into an object.
std::ifstream fin(n); <-- How can I make this work?