Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Unexpected Results
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Keith Thompson" data-source="post: 3168848"><p>[...]</p><p></p><p>It's likely that something in your program is invoking undefined</p><p>behavior, and you're getting results based on, for example, the</p><p>contents of memory that you haven't initialized.</p><p></p><p>The number of ways this can happen probably isn't infinite, but it's</p><p>close enough that there's no point in speculating on the cause without</p><p>looking at some code.</p><p></p><p>Try reducing your program down to something much smaller that still</p><p>exhibits the problem.</p><p></p><p>Another approach is to examine the values of variables as your program</p><p>is running (either in a debugger or by adding printf calls); it's</p><p>likely that some variable will take on a bad value before you see the</p><p>symptoms.</p><p></p><p>But your question is very close to "My program doesn't work; what's</p><p>wrong with it?".</p></blockquote><p></p>
[QUOTE="Keith Thompson, post: 3168848"] [...] It's likely that something in your program is invoking undefined behavior, and you're getting results based on, for example, the contents of memory that you haven't initialized. The number of ways this can happen probably isn't infinite, but it's close enough that there's no point in speculating on the cause without looking at some code. Try reducing your program down to something much smaller that still exhibits the problem. Another approach is to examine the values of variables as your program is running (either in a debugger or by adding printf calls); it's likely that some variable will take on a bad value before you see the symptoms. But your question is very close to "My program doesn't work; what's wrong with it?". [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Unexpected Results
Top