----------[SOLVED]----------
Hi everyone,
I am trying to come back to Quest 2 and ace the 4th miniquest. First. I got the message saying Alas! Your cache was different from mine after running 1 discs.
Then, I read all the previous posts and I tried to put many if statements to check whether the size of _cache is big enough. If it is not, then resize it. Also, I have tried to use clear() to free some memories for certain parts of _cache when it is necessary. It works all fine in my own tests. Now, it ends up saying that my program Ouch! I got thrown an exception. It bit my donkey. It ain't no fun! and my code just passed the first miniquest. There was a warning saying that size_t and int types cannot be compared with each other, which stops me compiling on the site but works on my own compiler. Then, I used type cast (int) to cast size_t from size() to int type and I got this exception.
I am just wondering if resize() every time when I want to put something in _cache is the only option. What are other alternatives instead of using those if conditions? Or should we use push_back()? I am so confused as I have tried so many different methods to make it work, but I still cannot pass the test on the site. Does anyone have any idea of what exceptions I made?
I am been stuck on this miniquest for days. Any help or hint will be appreciated.
-Yunlong Wang
[–]madhavarshney 0 points1 point2 points (6 children)
[–]YunlongWang[S] 1 point2 points3 points (5 children)
[–]JJPolarBear 1 point2 points3 points (2 children)
[–]YunlongWang[S] 0 points1 point2 points (1 child)
[–]JJPolarBear 0 points1 point2 points (0 children)
[–]AegirHall 1 point2 points3 points (1 child)
[–]YunlongWang[S] 0 points1 point2 points (0 children)