Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am currently working on a piece of code that will read in from a text file line by line. However, whenever I run the
I am currently working on a piece of code that will read in from a text file line by line. However, whenever I run the code it always causes the function to be stuck in an infinite loop.
Is there something I am doing incorrectly? I can't find the issue. I am using:
#include
#include
#include
and this is the function I am having issues with.
void displaySeats(){ ifstream file("example.txt"); string str; while(getline(file, str){ cout << str; cout << endl; } file.close(); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started