Misplaced Pages

0xFDFDFDFD: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 20:19, 6 January 2007 editBlakeCS (talk | contribs)1,088 editsmNo edit summary← Previous edit Revision as of 22:27, 6 January 2007 edit undoBlakeCS (talk | contribs)1,088 edits Redirected page to Magic number (programming)Next edit →
Line 1: Line 1:
#REDIRECT ]
'''<tt>0xFDFDFDFD</tt>''' is a number written in ] notation, with the ] value of 4261281277, with the ] value of 37577376775, and with the ] value of 11111101111111011111110111111101.

Hexadecimal notation is often used to display or transcribe values stored in ]. Most numbers, when displayed in hexadecimal, are uninteresting and not eyecatching. Sometimes, however, a ] is desired that will be easily recognizable when displayed in hexadecimal (for instance, during debugging, or in a log file) yet are unlikely to occur in normal operation of the program. <tt>0xFDFDFDFD</tt> is sometimes chosen as such a sentinel value so that programmers can recognize this value during programming or debugging. It has no specific meaning, and another recognizable number, such as <tt>0xABABABAB</tt> or <tt>0xCAFEFEED</tt>, would suffice.

Since it is unlikely that any given 32-bit integer would take this specific value (one chance out of 2<sup>32</sup>=4294967296), programmers often use this ] to investigate common errors such as buffer overflows, or uninitialized variables, when using a debugger. For instance, whenever this value appears in a ], its location is likely to be a point of interest for the programmer. Another example of its possible usage is to initialize various memory locations which programs are not supposed to access, making it easier to detect invalid code execution.

<tt>0xFDFDFDFD</tt> was used by ]'s C++ debugging heap to mark "no man's land" guard bytes before and after allocated heap memory.

{{Magicnums}}
{{computer-stub}}

]

Revision as of 22:27, 6 January 2007

Redirect to:

0xFDFDFDFD: Difference between revisions Add topic