Sign in to follow this  

Compiler or IDE Version

This topic is 4331 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am trying to make a code that can compile in Visual Studio .NET 2003 and in Visual C++ 2005 using the new "more secure" functions To be more clear: Use strcpy(this->m_pFileToParse, fileToParse); in VIsual Studio .NET 2003 and strcpy_s(this->m_pFileToParse, 1 + iStringSize, fileToParse); in Visual C++ 2005. Is there any VARIABLE that can make this code possible, something like #ifdef VS_2003 strcpy(this->m_pFileToParse, fileToParse); #else strcpy_s(this->m_pFileToParse, 1 + iStringSize, fileToParse); ???? Thanks in advance, sorry for the english

Share this post


Link to post
Share on other sites
Use the _MSC_VER macro, the MSDN says

"Defines the major and minor versions of the compiler. For example, 1300 for Microsoft Visual C++ .NET. 1300 represents version 13 and no point release. This represents the fact that there have been a total of 13 releases of the compiler.
If you type cl /? at the command line, you will see the full version for the compiler you are using."


So I'd assume 1400 is for 2005.

Share this post


Link to post
Share on other sites
Exactly what I wanted!

Thanks...

C:\Arquivos de programas\Microsoft Visual Studio 8\VC>cl /?
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

In Visual Studio 2005 it has _MSC_VER_GREATER_THEN_13102050 really usefull!

Share this post


Link to post
Share on other sites

This topic is 4331 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this