User forums > Using Code::Blocks
debuging the code: how add variables and arrays objects to watches window?
oBFusCATed:
It should be in the log of the debugger (probably in the full log, which you have to enable in the debugger settings).
I've told you about this already.
Another option is to define it to something that prints on stdout/stderr:)
cambalinho:
i use windows api applications. so it's there another way?
oBFusCATed:
Have you checked the log?
The debugger tab in you 'logs and others' window.
cambalinho:
i'm sorry, the string isn't printed on that tab :(
--- Code: ---button btnarray[8];
int WinMain()
{
int arraysize=ArraySize(btnarray, button);//geting the array size
//btnarray.resize(8);
int i=0;
for (i; i<arraysize; i++)
{
int inttop=150 + (i*50);
btnarray[i].setTop(inttop);
OutputDebugStr(to_string(btnarray[i].getTop()).c_str());//i belive these string must be printed on debugger tab, right?
btnarray[i].setLeft(0);
btnarray[i].setText(to_string(i));
btnarray[i].MouseClick=[i]()
{
MessageBox(btnarray[i].getText());
};
--- End code ---
oBFusCATed:
Generally this is the place where you should see it.
Have you enabled full log from the debugger?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version