Jump to content
  • Advertisement
Sign in to follow this  
suliman

Use defines in string? (c/c++)

Recommended Posts

3 minutes ago, Green_Baron said:

But this is not a string conversion warning but a qualifier warning, right ?

Right.  In C++ a string literal is of type "char const*" and assigning a pointer to const to a pointer to non-const without casting away the constness is not alllowed in C++.  Before C++11 there was an exception to the rule for string literals to provide backwards compatibility with C90 (which did not have const at all) but C++11 only required compatibility with C99, which does have const, so the exception to the rule was removed.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!