Author Topic: code project watch window display not showing correctly  (Read 4319 times)

Offline olaoni

  • Single posting newcomer
  • *
  • Posts: 4
code project watch window display not showing correctly
« on: June 26, 2007, 07:35:09 pm »
I download Code block yesterday. But I seem to be having problem with the debugger not showing the value of char data type correctly. It does however show the value of int data type correctly.

The following code display the following data value

#include <iostream>

//
// This is the main entry point
// It is used to see how code block works
int main()
{
    char tmp[20];

    for ( int i = 0; i < 20; i++ )
    {
        tmp = i;
    }

    return 0;
}

Value of tmp: "\000\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\021\022\023"

The version I am runing is :-
Code::Blocks IDE, with MINGW compiler
Filesize: 13,597,181 Bytes | Version: 1.0rc2
MD5 Hash: 7638bdd4fd087b3168be4f0f968d1f3c

Many thanks in advance.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: code project watch window display not showing correctly
« Reply #1 on: June 26, 2007, 07:42:37 pm »
olaoni: Your version of codeblocks is 1 1/2 years obsolete.

Better try out one of the latest builds.

http://forums.codeblocks.org/index.php/topic,6279.0.html

My recommendation is to try out the Jun 26 or Jun 23 builds. (Jun 26 is the latest, fixes an annoying bug; Jun 23 is the latest version before the bug in question appeared). The jun 22 is also good :)

Enjoy :) BTW, you better install fresh in a new directory (delete your old Codeblocks directory and reinstall)
« Last Edit: June 26, 2007, 07:45:46 pm by rickg22 »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: code project watch window display not showing correctly
« Reply #2 on: June 26, 2007, 07:45:38 pm »
First: you're using an old version of Code::Blocks. Please upgrade to a Nightly Build, even though it's not the cause of your problem.

The value of tmp being shown IS right. The line inside the for clause is wrong in the code you pasted, but it seems the one you compiled was right.

I don't really know what was your intention or what you expected to be shown as the value of tmp, but once again: the output IS right.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: code project watch window display not showing correctly
« Reply #3 on: June 26, 2007, 07:47:06 pm »
Ah yes, Ceniza is right. Better try starting out your loop at number 65, that's where the "A" character starts :)

P.S. Where did you download Codeblocks? i.e. which link took you to the download page? We need to update that.

Offline olaoni

  • Single posting newcomer
  • *
  • Posts: 4
Re: code project watch window display not showing correctly
« Reply #4 on: June 26, 2007, 11:20:09 pm »
The line inside the for clause is wrong in the code you pasted,
The code in the for() loop was correct but the browser removed the square brackets on the tmp. What I did
was a ctrl + c and ctrl + v on the code.


I don't really know what was your intention or what you expected to be shown as the value of tmp,
I am new to using Code Block and when I start on any new tool chain I write very trival programs to ensure the basic are okay.

NB: Thanks for the replies, I will try and download the 26 June 2007 build .