is there a way to fetch the error into a text
like for e.g in the php , we do mysql_query('select `what eva` from `wateva` where `wateva`='wateva'') or die (mysql_error());
well my point is that code (mysql_error()); will tell me what's wrong so i can fix it and the error result will change by the change of the error , if my words make sence lol
so is there a way in c++ to make it like save the errors in text or somthing.
But as you can see it's not very simple. Here's a copy/pastable function you can use for simplicity: (but please note I didn't test it so I can't say with 100% certainty that it will work, but it should):
Scripting language like PHP is very different with C++. Usually when functions fail in C++ it returns false or -1. There is no string representation of those like in PHP. Though redirecting the output of cout, cin, cerr is also possible in C++