I
I
IkaR492021-02-13 21:47:53
C++ / C#
IkaR49, 2021-02-13 21:47:53

Why does sscanf stumble on an extended ASCII character, but only in the release build?

There is a code:

char fmt[] = "%dю%d";
char str[] = "20ю15";
int one = 0;
int two = 0;
sscanf(str, fmt, &one, &two);

In debug it reads fine, in release it reads only the first number.
As a digit separator, you can use not only Cyrillic, but also any character from the extended ASCII table (there was a problem with the degree symbol - ° ).
Source codes in cp1251 encoding. MS VS 19 with toolset 141. Has anyone seen

this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
15432, 2021-02-14
@15432

Probably, you have different parameters for debug and release in your studio settings (Unicode/Multi-Byte)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question