String functions like strcpy,strcat,itoa...shows warning as "declared deprecated" in Visual Studio 8.0 instead it suggests to use functions which are enhanced secure versions of the same such as strcpy_s,strcat_s,_itoa_s.....using this in my file removes those warnings but i am using this same file in visual studio 6.0 here it gives compile time error as "undeclared identifier" which is correct as this old version of visual studio is not provided with the new added versions of above functions....so what is the solution for this as i want to use this same file in my VC6 as well as VC8 projects....plz help

#define strcpy_s strcpy
:D

#define strcpy_s strcpy
:D

.....thanks for this quick help..,,,, but both of these funtions have different parameters,,,strcpy_s has a additional parameter to strcpy which is the size of buffer,,,..hence #define strcpy_s strcpy gives compile time error in Visual Studio 8 itself,,,,,so nw wht to do??

use std::string

I agree, using strings would probably solve your problem. But since that wasn't your question, you could try:

#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE

#include <......> etc

which would take care of the "declared deprecated" warnings.

Or you could add #pragma warning (disable:4996) to your code

Here's a list of all the functions that are "deprecated"

I agree, using strings would probably solve your problem. But since that wasn't your question, you could try:

#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE

#include <......> etc

which would take care of the "declared deprecated" warnings.

Or you could add #pragma warning (disable:4996) to your code

Here's a list of all the functions that are "deprecated"

Thanks a lot ....#pragma warning(disable:4996) has solved my problem temporarily.....but later it may give problem as suppressing warning will give compile time errors for these functions as the newer version will remove these functions....but its ok!! for time being the problem is solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.