Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help make this compile, I've already wasted about 5 questions on this. Following error shows up when compiling: lab07.cpp: In function 'int main()': lab07.cpp:24:22:

Please help make this compile, I've already wasted about 5 questions on this.

Following error shows up when compiling:

lab07.cpp: In function 'int main()': lab07.cpp:24:22: error: 'stoi' was not declared in this scope year = stoi(yr); ^

My code:

#include #include #include using namespace std;

int main() { string movie_name, movie_snack, mov_snk, filename, yr; int year; ifstream dataIn; cout << "What is the name of the file?" << endl; cin >> filename; dataIn.open(filename.c_str());

if (dataIn.fail()) { cout << "** Invalid Filename **" << endl; } else { getline(dataIn, movie_name); getline(dataIn, yr); getline(dataIn, mov_snk); year = stoi(yr); movie_snack = mov_snk; dataIn.close(); cout << "Movie title: " << movie_name << endl; cout << "The movie will be 100 years old in " << year+100 << endl; cout << "Movie snack: " << movie_snack << endl; }

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions

Question

Describe five types of messages.

Answered: 1 week ago

Question

How do you think these files can be used for data analysis?

Answered: 1 week ago