I'm trying to compile some rather trivial code in C++ and i keep getting "Warning: [FUNCTION] was declared deprecated"
Now this is on some of the more useful functions such as:
sprintf
strtok
why is this? Here is a sample of my code if you are interested:
if(IsChatting()){
char chat[256];
GetPendingChat(chat);
char *token;
token = strtok(chat," ");
if(strcmp(token,"/bot")==0){
token = strtok(NULL," ");
if(token != NULL){
if(strcmp(token,"add")==0){
token = strtok(NULL," ");
if(token != NULL){
char msg[256];
sprintf(msg,"Attempting to enter bot with the name %s",token);
SendMessage(GetPlayerColour(GetLocalPlayerId()),msg);
//Enter(token);
SetChatting(false);
SetPendingChat("");
}
else{
SendMessage(GetPlayerColour(GetLocalPlayerId()),"SA:MP BOT: /bot add [name]");
}
}
}
else{
SendMessage(GetPlayerColour(GetLocalPlayerId()),"SA:MP BOT: /bot [add]");
}
}
}
The exact warnings are:
Warning 2 warning C4996: 'strtok' was declared deprecated c:\documents and settings\will\my documents\visual studio 2005\projects\dllbot\dllbot\keyhook.h 10
Warning 3 warning C4996: 'strtok' was declared deprecated c:\documents and settings\will\my documents\visual studio 2005\projects\dllbot\dllbot\keyhook.h 12
Warning 4 warning C4996: 'strtok' was declared deprecated c:\documents and settings\will\my documents\visual studio 2005\projects\dllbot\dllbot\keyhook.h 15
Warning 5 warning C4996: 'sprintf' was declared deprecated c:\documents and settings\will\my documents\visual studio 2005\projects\dllbot\dllbot\keyhook.h 18
I'm using Visual Studio 2005