I'm very new to coding and over the last few dasy I have been wacking my head agains t a brick wall. The problem I'm having is I have been given a .txt file to incorporate in to the code im writing and I need to be able to get indervidual lines from that .txt file out instead of displaying the entire file.
This is the information within the . txt file and what I want to do is call a single indervidual line from an ifelse statement. say if they land on property12 the ifelse statement calls that line from the .txt file?
Well, you have it sort of right. Instead of couting out the file, store it into an std::vector, then you can use .at() in order to access a specific line. There is no way to simply "read" a specific line of text since it basically a large line with a couple of "newline" characters that text editors interpret.