User forums > Help
Is the result of "printf" and "debug watch" different?
hnust_zhangyehua:
Would you like to leave your Facebook or other contact information, which can make our communication more convenient for i really want to
solve this problem?
BlueHazzard:
To solve the problem you can try the following steps:
1) post the code in code tags, so the formatting wont mess up
--- Quote --- for(x=0; x<w; x++)
{
if(a
==a[w])
break;
//z[w]=a[w];
}
--- End quote ---
here is clearly a error, because 'a' is a array, and you can't compare a integer 'a[w]' to a array (pointer)
2) Is your problem only in codeblocks or also in gdb:
a) What does the debugger log says if you type "p a" ? It can be possible that codeblocks parses the debug output wrong...
b) for this it would be nice if you can enable full debug logging (Settings->Debugger->Common->Full (Debug) log ) and then try to debug your application. If you detect the error please copy and paste the log from the "Debugger" tab here. (Please use also code tags (# symbol or [ code ][ \code ] for the log)
greetings
hnust_zhangyehua:
Thanks for your help.
I paste the code on the Ubuntu Pastebin
http://paste.ubuntu.com/18302527/
You can open the link which shows my code.
The line 16 on the code is my question.You can copy the code to the codeblocks,and then,use the input date and watch the output of the array C. Subsequently, you use "shift + F7" to debug, and use
"F4" to jump the line 84, and use "F7". In this monment, you can watch the "printf window" or the "debug watch" to check the array C , ans you will find the difference from array c.
I really thanks for your help ;D
BlueHazzard:
sry, but i can't find any discrepancy...
can you post a screenshot?
hnust_zhangyehua:
the first photo is the "printf" after execute
the second photo is the "print" in the process of debug
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version