well it takes the line of the file and puts it in tab at space [i] and then increments it
Well that was a lot easier than expected... :P. Thanks.
cout.precision(11);
cout << "Pi: " << 3.1415926536 << endl;
This is unrelated to the main program however, I just wanted to know how C++ counts through those Pi digits and how the precision function works.
if i remember correctly it will only show the first 11 of the float literal digits
Yeah that seems to clear it up.
Thanks.
I have another query, I would create a new thread but I can't at the moment:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
int main(int argc, const char * argv[])
{
// insert code here...
string lang = "C++";
int num = 1000000000; // One billion.
// Try-catch block goes here.
cout << "Program continues..." << endl;
try { lang.replace(100, 1, "C");}
catch(out_of_range &e)
{
cerr << "Range Exception: " << e.what() << endl;
cerr << "Exception Type: " << typeid(e).name();
cerr << endl << "Program terminated." << endl;
return -1;
}
cin.get();
return 0;
}
|
I was just wondering what is Range Exception and what is Exception Type.
Thanks.
Last edited on