The following code is designed to create a simple exit condition. If the user types 'exit', the program exits. But before I get to that, I need to use strncmp to evaluate the character array to determine that this is what the user entered.
I type 'exit' into the terminal, but strncmp doesn't evaluate to 'true'. Why? What am I missing? Thanks!
You might not agree with them, but that doesn't alter the fact that they have marked strcmp, along with a lot of other calls, as deprecated.
warning C4996: 'sprintf': This function or variable may be unsafe. Consider using
sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
1> C:\Program Files\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) :
see declaration of 'sprintf'
It's strcpy, etc (and sprintf) I was mis-thinking about...
It is only the problem of Microsoft. As for others then that stupidy of Microsoft only annoys programmers.
By the way I would like to remind you that the Microsoft compiler is very bad and has numerous bugs.
Moreover using strncmp is this example is indeed a bug!:) The user could enter some word that has initial letters as exit but the whole word entered by the user is not equal to exit. For example the user could enter "exit poll".:)