line 167 through 179 is a code my professor had provided. however when I try and
ID: 3916353 • Letter: L
Question
line 167 through 179 is a code my professor had provided. however when I try and run it I obtain errors that I am not sure how to fix.
below are screenshots of my code and errors
***if someone can please provide me with the code that will correct my errors or allow it to run it would be much appreciated thank you
File Edit View Project Build Incredibuild Debug Team Tools Process, [19124] ConsoleApplication16.exe-|?Lifecycle Events ? Thread: ConsoleApplication16.cpp ? ? ConsoleApplication16 #include #include?algorithm» #include "stdafx.h" #include 1 B 5 | #include #include #include #include #include #include #include?iterator> «stdlib le 11 12 13 14 using namespace std; 15 gint main() ofstream fout; ifstream fin; fin.open("C:lUsers laidanl IDesktop)Icoding files lCitiBike.txt"); if (fin.is_ open()) f 28 25 26 if (fin.is open()) ( 28 29 3e 32 32 coutExplanation / Answer
The problem with your code is accessing the map iterator the wrong way. You are doing:
(I*).first
Change it to:
A sample code that iterates over map:
So, the operator a->b means (*a).b, not (a*).b. Change that, and your code will work fine if there isn't any other error.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.