Quote:
Originally Posted by dugan
Why are you not using strings?
|
some dweb told me to use char for reading in files, so I changed it to char*, then I changed it back to string, and do a conversion on it for the reason it needs a char * to read.
Code:
else if (S_ISREG(st.st_mode))
{
// std::cout << "files "<< path<<std::endl;
std::stringstream newStringPath;
newStringPath << path;
std::string myStringPath = newStringPath.str();
opts.dfile.push_back( myStringPath );
opts.g++;
}
then when I need it to be a char *
Code:
std::string newFilename = walk_down(); // returns one element in the vector<string>
const char* filename = newFilename.c_str();
std::cout << " filename "<<filename<<std::endl;
img.image = imlib_load_image(filename);
Now I am NOT getting any garbage in the input, and that part of it is now working.