<p>Can someone describe what a symbol table is within the context of C and C++?</p>

[{'answer_id': 69117, 'author': 'Steve Landey', 'author_id': 8061, 'author_profile': 'https://Stackoverflow.com/users/8061', 'pm_score': 5, 'selected': False, 'text': "<p>Briefly, it is the mapping of the name you assign a variable to its address in memory, including metadata like type, scope, and size. It is used by the compiler.</p>\n\n<p>That's in general, not just C[++]*. Technically, it doesn't always include direct memory address. It depends on what language, platform, etc. the compiler is targeting.</p>\n"}, {'answer_id': 69125, 'author': 'Allan Wind', 'author_id': 9706, 'author_profile': 'https://Stackoverflow.com/users/9706', 'pm_score': 2, 'selected': False, 'text': '<p>Check out the <a href="http://en.wikipedia.org/wiki/Symbol_table" rel="nofollow noreferrer">Symbol Table</a> wikipedia entry.</p>\n'}, {'answer_id': 69162, 'author': 'Joe Schneider', 'author_id': 1541, 'author_profile': 'https://Stackoverflow.com/users/1541', 'pm_score': 3, 'selected': False, 'text': '<p>The symbol table is the list of "symbols" in a program/unit.  Symbols are most often the names of variables or functions.  The symbol table can be used to determine where in memory variables or functions will be located.</p>\n'}, {'answer_id': 69169, 'author': 'Ben Combee', 'author_id': 1323, 'author_profile': 'https://Stackoverflow.com/users/1323', 'pm_score': 8, 'selected': True, 'text': '<p>There are two common and related meaning of symbol tables here.</p>\n\n<p>First, there\'s the symbol table in your object files.  Usually, a C or C++ compiler compiles a single source file into an object file with a .obj or .o extension.  This contains a collection of executable code and data that the linker can process into a working application or shared library.  The object file has a data structure called a symbol table in it that maps the different items in the object file to names that the linker can understand.  If you call a function from your code, the compiler doesn\'t put the final address of the routine in the object file.  Instead, it puts a placeholder value into the code and adds a note that tells the linker to look up the reference in the various symbol tables from all the object files it\'s processing and stick the final location there.</p>\n\n<p>Second, there\'s also the symbol table in a shared library or DLL.  This is produced by the linker and serves to name all the functions and data items that are visible to users of the library.  This allows the system to do run-time linking, resolving open references to those names to the location where the library is loaded in memory.</p>\n\n<p>If you want to learn more, I suggest John Levine\'s excellent book "Linkers and Loaders".<a href="http://books.google.com/books?id=h34d_jr2iikC&amp;dq=levine+linkers+and+loaders&amp;pg=PP1&amp;ots=IxGcKQO03W&amp;sig=dduAcRRhK6E2nMlkTxbNEDpWBTg&amp;hl=en&amp;sa=X&amp;oi=book_result&amp;resnum=1&amp;ct=result" rel="noreferrer">link text</a></p>\n'}, {'answer_id': 6862556, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 4, 'selected': False, 'text': '<p>In Linux, you can use command: </p>\n\n<blockquote>\n  <p>nm [object file]</p>\n</blockquote>\n\n<p>to list the symbol table of that object file. From this printout, you may then decipher the in-use linker symbols from their <a href="https://en.wikipedia.org/wiki/Name_mangling" rel="nofollow noreferrer">mangled names</a>.</p>\n'}, {'answer_id': 47056271, 'author': 'rashedcs', 'author_id': 6714430, 'author_profile': 'https://Stackoverflow.com/users/6714430', 'pm_score': 0, 'selected': False, 'text': '<p>Symbol table is an important data structure created and maintained by compilers in order to store information about the occurrence of various entities such as variable names, function names, objects, classes, interfaces, etc.</p>\n'}, {'answer_id': 71186085, 'author': 'andreyk2 Hohlov', 'author_id': 10696080, 'author_profile': 'https://Stackoverflow.com/users/10696080', 'pm_score': 0, 'selected': False, 'text': '<p>From the &quot;Computer Systems A Programmer’s Perspective&quot; book, Ch 7 Linking. &quot;Symbols and Symbol Tables&quot;:</p>\n<blockquote>\n<p>Symbol table is information about functions and global variables that\nare defined and referenced in the program</p>\n</blockquote>\n<p>And important note (form the same chapter):</p>\n<blockquote>\n<p>It is important to realize that local linker symbols are not the same\nas local program variables. The symbol table does not contain any\nsymbols that correspond to local nonstatic program variables. These\nare managed at run time on the stack and are not of interest to the\nlinker</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/69112', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10774/']