Also I am working on making a program like the one above that will read multiple lines of data but I am pretty lost. I know how many lines their are from the first line of the code but I am unsure how to integrate this into the code as needed.
To say nothing about the rest of your program... This statement will try to read past the end of vector P, causing an assertion error for subscript oorange:
1 2
for (size_t i = 0; i <= P.size(); i++)
cout << P[i] << "\t" ;
size() returns the number of elements in the vector. If the size of P is 5, the last valid iterator is 4. Instead:
1 2
for (size_t i = 0; i < P.size(); i++)
cout << P[i] << "\t" ;
Yea I figured that out. I added a return(P) at the end. The thing does exactly what it was supposed to now. I am working to enhance it now though and failing miserably. different topic though.