By: yeokaiwei
Unhandled exception at 0x0082373C in Chapter7FractionStruct.exe: 0xC0000094: Integer division by zero. Errr... I think something weird occured...
View ArticleBy: nascardriver
You only need to update these 2 lines 12 const Fraction f1{ getFraction() }; const Fraction f2{ getFraction() }; For example 12 const Fraction f1{ 22, 7 }; const Fraction f2{ 1, 1 }; With...
View ArticleBy: nascardriver
Yes, because "You're performing integer division twice in line 25 (Only casting the result (Which is already an integer) of the first division to a `double`)." 12345 // this is an integer...
View ArticleBy: yeokaiwei
Ah, I finally figured out what you were saying. It works now. It's due to my bracket placement. I did a static_cast<double(numerator)twice to make doubly sure. 1 return...
View ArticleBy: Alex
I don't understand why in the solution of question #2 you define the variables f1 and f2 of type const. Could you explain why? Here's how a wrote the program:...
View ArticleBy: nascardriver
Everything that you don't want to modify should be `const`. Very few lessons follow this rule (I don't think this is a learncpp rule yet) at this point. Making everything `const` prevents you from...
View ArticleBy: bool_wp
Solution for Q.1 12345678910111213141516171819202122232425262728293031323334353637383940 #include<cstdlib>#include<iostream> struct Advertising{ int allAds; double...
View ArticleBy: hi
I like this solution! Very well organized and easy to follow. Why #include <csdtlib>?
View ArticleBy: bool_wp
Hello and thank you! I'm used <cstdlib> for return EXIT_SUCCESS; instead return 0;(for me 0 as a magic number-does not say anything)
View Article
More Pages to Explore .....