Undefined Behavior

Why Trust Techopedia

What Does Undefined Behavior Mean?

In computer science, undefined behavior happens when a computer language does not handle a certain operation that is coded into a codebase. Some experts describe this as “assumptions made by translators of a source code,” suggesting that when there is not a procedure for a certain syntax, that leads to a problem that is hard to predict in terms of its resolution.

Advertisements

Techopedia Explains Undefined Behavior

Undefined behavior can take many forms. As mentioned, it occurs when some type of problem or operation is not built into the language that a programmer is using. For example, C and C++ have their own range of undefined behaviors according to how the language was created. One common example of undefined behavior is a situation where a program indexes an array outside of its bounds. Other examples have to do with dividing numbers by zero, printing a null value, or pointing to some memory location that is not there. All sorts of bugs or glitches in a computer programming code can create various different kinds of undefined behavior that engineers and programmers need to look out for.

Advertisements

Related Terms

Margaret Rouse
Technology expert
Margaret Rouse
Technology expert

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.