0
What's wrong with my code?
can someone explain why my code is coming out with an error? please be specific about what I need to change and why! https://code.sololearn.com/c07W0uy4tqat
6 Réponses
+ 1
im not even good at c++ but this was easy,youre using cout without declaring its namespace,duh!
you either use std::cout or declare
using namespace std
https://code.sololearn.com/cmrnauw8m39j/?ref=app
0
What are you talking about? I legitimately can't figure out what's missing from the code. I just started learning C++ around 2 weeks ago.
0
Thank you, @Brains!
See, Akib Reza, that wasn't so hard
0
@Brains why does it output 2324 instead of 2325? Isn't the code increasing each of the inputs by 1?
0
Not work like you think... Your static variable i "remember" last value setted (thanks to static modifier) but it reset for different template types because is like you defined 2 func functions (one for int type and on for double type) but this is maded by compiler and hided to programmer
0
Well namespace std was in there but I didn’t have the std::cout; in there