Jump to content
  • Advertisement
Sign in to follow this  
BrickInTheWall

@ - Symbol in C/C++?

This topic is 3285 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, Quick and probably stupid question here. I've seen a few code examples with the "@" symbol when defining constants and can't find anywhere what they mean...for example: #define SOMETHING @0x00 Whats it all about? Cheers!

Share this post


Link to post
Share on other sites
Advertisement
It is non-standard, so you have to check your compiler's documentation. Some use I've seen for it is to force the variable's location in memory, to make an alias for a memory mapped register for example.

Share this post


Link to post
Share on other sites
Inside a macro (a.k.a. #define), the @ symbol means that the thing that follows is a character.

If you have a copy of the language standards handy, search for @\n for an example usage.


So @0x00 would mean to use the character value 0, with no other parsing or replacement.

Share this post


Link to post
Share on other sites
In other words, it's a way for somebody to embed NULL character directly in their source file, for some reason.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!