0
base template always return 0
but the template specialization works properly, why? https://code.sololearn.com/coCFFSxB4Q2r/?ref=app
10 odpowiedzi
+ 1
The correct line is: cin >> character >> number;
not cin >> character, number;
+ 1
thx ~ swim ~
but problem persists: num always 35
+ 1
~ swim ~ now throws error, check if u wish
0
Dennis
thx, but the problem persists when pass a char in number, it should return its ASCII num
0
Did you enter 2 inputs?
For example
t 5
or
t
5
0
both does the same, returns 0 when pass char as number
0
If you want the char to output its ascii value then you should also cast it to an int.
0
Dennis
casted it in the output f() but no works
int(var)
or
int(var)
so it must be casted before passing it to a func
will use scanf and printf to doit, C always saving your ass
0
yes, read it
now I used scanf and printf and don't know why, now char empty and int 35
0
yes, but mind while enter just chars it should return ascii num
im using scanf and printf now
maybe a sololearn's compiler bug?