how can I store the only 3 number integer to the currentvalue that in structure Stock ? the 3 integer is represent currentValue , so if the other item that don't have 3 integer will be ignored automatically , it's hard for me . can someone help? i do a lot research but still can't understand
You can take this sample code as a base for your program. The only you need is to use std::getline to read records of the file and then apply the idea showed in the sample code.
I have not understood your questions. I took one record from your text file as an example and showed how you can extract the third item of the record.
You may declare variable n as you like either as int n; or size_t n;.
I think it would be useful if you would compile and try my example supplying required headers.