How to see a static variable in a watch window 
Author Message
 How to see a static variable in a watch window

Is there any way to see a variable(declared by static) in a watch window?

void main()
{
    static int i=10;
    ...

Quote:
}

thanks in advance.


Wed, 30 Jun 2004 22:00:52 GMT  
 How to see a static variable in a watch window

    Adding 'i' to the watch window displays its value for me in VC 6.0. What
seems to be the problem ??

Cheers
Check Abdoul
-----------------


Quote:
> Is there any way to see a variable(declared by static) in a watch window?

> void main()
> {
>     static int i=10;
>     ...
> }

> thanks in advance.



Thu, 01 Jul 2004 01:29:49 GMT  
 How to see a static variable in a watch window
That will only work when you are inside the function. Outside of the function
you should be able to use the advanced breakpoint syntax - in the index
look for "using advanced breakpoint syntax". For your example it will
be something like:

{main,main.cpp,myprogram.exe}i

although for most cases you could simplify that down to:

{main}i

It works for me.

Quote:

>     Adding 'i' to the watch window displays its value for me in VC 6.0. What
> seems to be the problem ??

> Cheers
> Check Abdoul
> -----------------



> > Is there any way to see a variable(declared by static) in a watch window?

> > void main()
> > {
> >     static int i=10;
> >     ...
> > }

> > thanks in advance.



Thu, 01 Jul 2004 02:31:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Variables in Variables / Watch window

2. watch a static variable

3. Watch a local static variable outside of function?

4. Watching static variables doesnt work in MSVC 4.2 but does in 5.0

5. watch a static variable

6. Variable data not showing in watch windows

7. Problems with Variables and Watch Windows

8. Q: variable / watch window

9. How to add variable to watch window

10. use "Watch Window" to validate variables

11. view arrays in watch/variable window

12. wrong value for a variable showing in the watch window

 

 
Powered by phpBB® Forum Software