3 ms·
Should always compile to show all the warnings, then cast pennies to size_type to fix the warning
by axus 13y ago
Should always compile to show all the warnings, then cast pennies to size_type to fix the warning
- smitec 13y agoI fully agree, a someone who has taught programming to people the one step that seems to take people from program copiers to programmers is the ability to read and understand error messages and warnings. The number of times the answer is staring people in the face is quite surprising. If you are actively ignoring warnings is it any wonder things don't work as expected. The question as to whether -Wall should be default is another issue but I hardly blame C++ for this issue.
- deletes 13y agoActually you should cast name.length to int otherwise you leave the error in. Casting negative number to unsigned(size_t) would get you a large positive number.