Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ how would you read from a txt file using stringstream the txt file is as followed: {name: joseph, age: 19, gpa: 4.0} {name:
in c++ how would you read from a txt file using stringstream
the txt file is as followed:
{name: joseph, age: 19, gpa: 4.0}
{name: maria, age: 23, gpa: 3.4}
{name: kevin, age: 21, gpa: 3.8}
but is there a way to dissect the data name, age, gpa
into something like
{
stringstream ss(data);
ss >> arrayData[i].name;
ss >> arrayData[i].age;
ss >> arrayData[i].gpa;
}
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