What does “symbol” mean as in “Load Symbol List”? Or as in this example from MSDN:
“#if lets you begin a conditional directive, testing a symbol or symbols to see if they evaluate to true.”
Where are these symbols defined and declared?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For “Load Symbol List”, a symbol is a defined element in the syntax of a programming language. A local variable name is a symbol. A class type identifier is a symbol. PDB files contain symbol information so the debugger can know where things reside and what their names were in the original source code.
For #if, “symbol” means a preprocessor (c++) or conditionally defined (C#) symbol. C# doesn’t have a preprocessor phase so the terms can be a little confusing.
You define a conditional symbol using #define:
#define WIN32You test for whether a symbol is defined using #if:#if WIN32<…>#endifPreprocessor symbols are typeless and generally do not intersect with the types and identifiers that are actually part of your program code. The preprocessor sits “above” your source code. Preprocessor symbols don’t exist in the compiled output and don’t take up any memory space at runtime. Logically speaking, the compiler never sees the preprocessor syntax – it’s removed before the text reaches the compiler proper.