Numerics to defines constants??

This is a discussion on Numerics to defines constants?? within the Windows Programming forums, part of the Platform Specific Boards category; I amself-taught(learning) C and need some basic help please. Using VC/C++ 6.0. When debugging, the return result is a number, ...

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    5

    Question Numerics to defines constants??

    I amself-taught(learning) C and need some basic help please. Using VC/C++ 6.0. When debugging, the return result is a number, such as 0, 1, 2, etc. Petzold says we never have to worry about what the numbers mean, just use the letter constants. He never says how we are to translate the numbers into constants though. What number, for example, does the parameter TA-BOTTOM equate to? How are we to find out in debugging?? In debugging, only the number shows. IDOK and IDCANCEL are simple, but somtimes the return value number and the equivalent predefined constant are not so easy to figure out.Sometimes I need to figure out what number TA-BOTTOM, for example, means. What basic fact am I missing here???
    Many thanks for your answer. (I did look it up in MSDN andSearch, but no luck. It is like looking up a word in a dictionalry without knowing the first few letters.
    Again, many thanks!

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,646
    Right click on the symbol you want to know the value of and hit "Go To Definition Of <symbol>".

    gg

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    5

    Question Going from number to symbol?

    Your answer is fine if you have the symbol; but debug just gives the number (as far as I know). Suppose the return result is 5. How do I go from 5 to the symbol? 5 means nothing to me and if you lookup the API, it only gives the possible symbols. How do you go to the definition of 5? I have discovered there may be several built-in symbols of, using my example, 5.
    Thanks!

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,646
    ...if you lookup the API, it only gives the possible symbols.
    Then type in the name of the symbol, right click it, and select "Go To Definition Of <symbol>".
    Or use "Edit->Find in Files" to search for the symbol in all the header files.

    I also highly recommend this program.

    gg

  5. #5
    Registered User
    Join Date
    Nov 2003
    Posts
    5

    Thanks, gg.

    Thanks fopr your help, gg. That program looks interesting. I'm going to download it and see what it does! As the reviews say, the VC/C++ 6.0 IDE has some nice features missing.
    Thanks again!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. COnstants
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 09-01-2007, 04:59 AM
  2. Trying to redefine library #defines
    By Mario F. in forum C++ Programming
    Replies: 4
    Last Post: 06-18-2007, 07:30 AM
  3. enum constants as array indices
    By hzmonte in forum C Programming
    Replies: 2
    Last Post: 01-23-2006, 07:23 PM
  4. defines take up less space
    By Stan100 in forum Game Programming
    Replies: 5
    Last Post: 10-21-2003, 01:42 AM
  5. Help with Constants and enum constants. Newbie learning C++.
    By UnregJDiPerla in forum C++ Programming
    Replies: 5
    Last Post: 01-07-2003, 07:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21