Code:
int Id;
Id = lines[0];
No, because lines[0] is a string, and you want to assign it to an int.
You can get an integer value from a string like this
Code:
#include <iostream>
#include <strstream>
#include <string>
int main(int argc, char *argv[])
{
std::string blah="212";
std::string blah2="32";
std::istrstream inputBlah(blah.c_str()); // make input stream from blah's input, will function like cin
std::istrstream inputBlah2(blah2.c_str()); // make input stream from blah2's input
int intBlah, intBlah2;
inputBlah >> intBlah; // get value of intBlah from the inputBlah stream
inputBlah2 >> intBlah2; // get value of intBlah2 from inputBlah2 stream
std::cout << "Integer sum of blah and blah2 is " << intBlah + intBlah2 << std::endl;
char wait; cin >> wait;
return 0;
}