constant definitions

This is a discussion on constant definitions within the C++ Programming forums, part of the General Programming Boards category; Hello, Ok, I was wondering how do you write a constant definition, like the number of miles i live from ...

  1. #1
    K&J
    K&J is offline
    Registered User
    Join Date
    Oct 2001
    Posts
    9

    Unhappy constant definitions

    Hello,
    Ok, I was wondering how do you write a constant definition, like the number of miles i live from my school or the number of ounces in a pound?
    Thanks![SIZE=3][B]

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    const int OZ_TO_LB = 16;
    const int DISTANCE_FROM_SCHOOL = 12;
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 09:43 AM
  4. Try out my new game :) !
    By Stan100 in forum Game Programming
    Replies: 10
    Last Post: 06-05-2003, 08:10 AM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM

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