Thanks for the help so far!
Ok, I found a way for me to parse the variable from the value, and display them. The problem is when I use 2 ints as the arguements for .substr the second one not used... Also, my next step is going to be to make it stop displaying the lines of //////////////// so any tips on that are welcome.
Code:
#include <iostream>
#include <fstream>
#include <string>
int main ( int argc , char ** argv )
{
std::string filename = "C:\\Program Files\\EasyPlayer\\easyplay.ini";
if (argc >= 2) filename = argv[1];
std::ifstream file( filename.c_str() , std::ios::in );
std::cout << "Reading from: " << filename << std::endl;
std::string line;
while (getline( file , line ))
{
if (line.empty() || (line == "\r")) continue;
int equal_pos = line.find('=');
int comment_pos = line.find('/' && '/');
std::string key = line.substr(0,equal_pos);
std::string value = line.substr(equal_pos+1,comment_pos);
std::string comment = line.substr(comment_pos+2,line.size()-comment_pos-1);
std::cout << "Key: " << key << " " << "Value: " << value << " " << "Comments: " << comment << std::endl;
}
std::cin.get();
}
~Wraith