I thought scanf_s is better to use than scanf because it is "safe", according to this website. Also, what is the difference of standard, and non standard?
I thought scanf_s is better to use than scanf because it is "safe", according to this website. Also, what is the difference of standard, and non standard?
if should be something like
"If you do not want to see error messages like this in the future define DEPRECATED_FUNCTION_CALLS"
Check the whole output not only error messages. I cannot remember the exact macro name
UPD: look slike it is _CRT_SECURE_NO_WARNINGS
Last edited by vart; 07-15-2013 at 11:00 PM.
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
@ varta. it works thank you
I have a question related to this, should I start a new thread?
That's one of the problems with the WEB. Anyone can publish anything and be considered an expert, and never be idenitified. A WIKI article in my opinion should never be taken as expert advise. Use these articles as stepping stones to find attributed articles so you can research the qualifications of the authors and the relibility of the advice given.I thought scanf_s is better to use than scanf because it is "safe", according to this website.
I suggest you learn to properly use the standard functions, the functions outlined in the ISO C standard. In my opinion the scanf_s() functions are giving you a false sense of security, they can also be misused and cause the same type of problems. Plus I don't see any use of these functions when dealing with anything other than character strings.
If it's related then this is the place to ask.I have a question related to this, should I start a new thread?
Jim
@jim, what it the difference of %lg and %la?. Is it because of the bytes?
First since you're using the outdated Microsoft compiler I don't recommend you use the "%a" format specifier since that specifier was added in the C99 standard and Microsoft's support for anything other than C90 is severly lacking. But the added 'l' (lower case 'L') signifies a double (long float).what it the difference of %lg and %la?. Is it because of the bytes?
Jim