1

I am a beginner of C coding. I met a strange problem recently, I wrote a statement like this:

scanf_s("%lf",&num); 

here num is a long double type variable that I declared before.

Every time I type in like "1E", "1e" or "1ea", an 'e' or 'E' followed by a number, then num will get nothing.

But if I type in like "1a", "1b" or "1d", any other letters followed by a number, then the number will be taken correctly.

It is so weird. Would anyone please me with this, thank a mil!

Support Ukraine
  • 42,271
  • 4
  • 38
  • 63
  • 1
    Does this answer your question? [How to scanf a float followed immediately by the letter 'e' in c?](https://stackoverflow.com/questions/36086616/how-to-scanf-a-float-followed-immediately-by-the-letter-e-in-c) – Tyberius May 15 '20 at 03:31

0 Answers0