0

"scanf" function problem(c++)

what is wrong with "scanf"? Is this function not working in the compiler "sololearn"? https://code.sololearn.com/c9Pv50SfWuxk/?ref=app

13th Oct 2020, 6:37 AM
Wagen David
Wagen David - avatar
5 Answers
+ 2
I know it is not related to your problem. But you should not use scanf in c++. Use it in C, but not in c++. Use cin instead. Remember that c and c++ are two completely different langages, and that what is correct in C is often a bad practice in c++.
13th Oct 2020, 7:46 AM
Théophile
Théophile - avatar
+ 2
thank you for the detailed answer 👍🏼😀
14th Oct 2020, 12:49 AM
Wagen David
Wagen David - avatar
+ 2
with "cin" doesn't work too 🤔
14th Oct 2020, 2:27 AM
Wagen David
Wagen David - avatar
0
for example in this code it doesn't work(but I couldn't apply this function anywhere, so I used "cin"): https://code.sololearn.com/c9Pv50SfWuxk/?ref=app
13th Oct 2020, 9:16 AM
Wagen David
Wagen David - avatar
0
I think Theophilе is right about c and c ++. Thought that this function can be used in the C ++ language. I'll check it a little later on another compiler
13th Oct 2020, 9:23 AM
Wagen David
Wagen David - avatar