Main Topics
Browse All TopicsThe below is the warning I get when I try to debug inputs to my program:
warning C4996: 'scanf' was declared deprecated
It refers to this string: scanf(" %c%c%c", &first, &second, &third);
I cannot figure out what is wrong. Can anyone help?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This is a microsoft CRT related warning. You can use
#pragma warning(disable:4996)
to disable the warning, then
#pragma warning(default:4996)
to reset it. Use before, after main method, respectively.
Alternately, try a later Microsoft CRT, or an alternate CRT.
Also, you can use scanf_s instead:
http://msdn.microsoft.com/
Regarding the access violation:
In case you didn't check the msdn link, note the following excerpt:
==========
Unlike scanf and wscanf, scanf_s and wscanf_s require the buffer size to be specified for all input parameters of type c, C, s, S, or [. The buffer size is passed as an additional parameter immediately following the pointer to the buffer or variable. For example, if reading a string, the buffer size for that string is passed as follows:
char s[10];
scanf_s("%9s", s, 10);
The buffer size includes the terminating null. A width specification field may be used to ensure that the token read in will fit into the buffer. If no width specification field is used, and the token read is too big to fit in the buffer, nothing will be written to that buffer.
==========
Your line of code could be written as follows:
Business Accounts
Answer for Membership
by: StrongBad_RulesPosted on 2008-10-10 at 21:23:31ID: 22692679
Could you put the whole code on here or at least the declarations?