Vizualizare bit flag-uri in debugger-ul din VS 2008

Intrebari despre programarea cu VC++ incluzand mediul de dezvoltare, instalare, setari, debugger, compilator, linker si documentatie.
Post Reply
User avatar
Marius Bancila
Fondator
Fondator
Posts: 2344
Joined: 11 Jul 2007, 11:45
Judet: Timiş
Location: Timisoara
Contact:

Vizualizare bit flag-uri in debugger-ul din VS 2008

Post by Marius Bancila » 14 Mar 2008, 11:10

Am descoperit recent un feature misto in VS 2008: vizualizarea flag-urilor in debugger-ul nativ din VS 2008.

Sa zicem ca avem acest enum:

Code: Select all

enum Weekdays
{
   Monday = 1, 
   Thuesday = 2,
   Wednesday = 4,
   Thursday = 8,
   Friday = 16,
   Saturday = 32,
   Sunday = 64
};
si zicem

Code: Select all

Weekdays weekend = (Weekdays)(Saturday | Sunday);
Daca ne uitam in debugger la valoarea lui weekend, nu o sa fie 96 ci Saturday | Sunday.

http://blogs.msdn.com/vcblog/archive/20 ... ation.aspx


Marius Bancila
Fondator Codexpert, Microsoft MVP VC++
Site personal | Blog

Post Reply