How To Solve "Unhandled exception: std::invalid_argument"?

Hello Professionals,

I have been trying many times to resolve this issue and also searched in Google some solutions but I ended up not finding the solution to my problem.
Every time I run my code, I get this prompt from <string>:

Unhandled exception at 0x764C1812 in 
Tani's Method.exe: Microsoft C++ exception: std::invalid_argument at memory location 0x006FEE18.

The only thing I used <string> in my code is this very only line of code:

#include <string>
const std::string fName = "pyramid.obj"; // OBJ file 

I think there's no problem with it. But why I still get an error? Can anyone shed light on this matter? Thanks in advance.
Last edited on
If it isn’t a problem with stoi() (and related functions), then what is the code that is causing the exception?
Oh, I see now the problem. I tried to change the obj file to another one (e.g. sphere.obj). It worked fine now. Maybe there's something fishy with the pyramid file? I am not sure though. Thank you Duthomhas! :)
Topic archived. No new replies allowed.