Here is my text file: Azrin, Neil ------------------ Babbage, Charles ----------
ID: 3617758 • Letter: H
Question
Here is my text file:Azrin, Neil ------------------ Babbage, Charles ------------------ Boole, George ------------------ Burks, Arthur ------------------ Crick, Francis ------------------ Curie, Marie ------------------ Einstein, Albert ------------------ Franklin, Rosalyn ------------------ Heisenberg, Werner ------------------ Hofstadter, Douglas ------------------ Krieger, Dorothy ------------------
How do I go through the text file and store the name into astring, print it, skip the next line, and store the next name,print it, ect.. ?
Azrin, Neil ------------------ Babbage, Charles ------------------ Boole, George ------------------ Burks, Arthur ------------------ Crick, Francis ------------------ Curie, Marie ------------------ Einstein, Albert ------------------ Franklin, Rosalyn ------------------ Heisenberg, Werner ------------------ Hofstadter, Douglas ------------------ Krieger, Dorothy ------------------
How do I go through the text file and store the name into astring, print it, skip the next line, and store the next name,print it, ect.. ?
Azrin, Neil ------------------ Babbage, Charles ------------------ Boole, George ------------------ Burks, Arthur ------------------ Crick, Francis ------------------ Curie, Marie ------------------ Einstein, Albert ------------------ Franklin, Rosalyn ------------------ Heisenberg, Werner ------------------ Hofstadter, Douglas ------------------ Krieger, Dorothy ------------------
How do I go through the text file and store the name into astring, print it, skip the next line, and store the next name,print it, ect.. ?
Azrin, Neil ------------------ Babbage, Charles ------------------ Boole, George ------------------ Burks, Arthur ------------------ Crick, Francis ------------------ Curie, Marie ------------------ Einstein, Albert ------------------ Franklin, Rosalyn ------------------ Heisenberg, Werner ------------------ Hofstadter, Douglas ------------------ Krieger, Dorothy ------------------
How do I go through the text file and store the name into astring, print it, skip the next line, and store the next name,print it, ect.. ?
Explanation / Answer
Please Rate:) Example.txt Azrin, Neil ------------------ Babbage, Charles ------------------ Boole, George ------------------ Burks, Arthur ------------------ Crick, Francis ------------------ Curie, Marie ------------------ Einstein, Albert ------------------ Franklin, Rosalyn ------------------ Heisenberg, Werner ------------------ Hofstadter, Douglas ------------------ Krieger, Dorothy ------------------ ReadingFile.cpp // reading a text file #include #include #include using namespace std; int main () { string line; ifstream myfile ("example.txt"); if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.