Saturday, May 22, 2010

What is bus error in C ? Explain with examples.?

A bus error typically means that you're trying to reference memory outside of of the program's bounds or that you're referencing memory through an uninitialized pointer.





For example,


int c;


scanf("%d", c)





will produce an error because you're not using the address of operator (%26amp;) when supplying the variable c.


No comments:

Post a Comment