Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualCornstalks

Posted 18 March 2013 - 09:44 PM

But they could have made it useful by adding pluses!

#define ONE     +1
#define TWENTY  +20
#define HUNDRED +100
 
// Here's a little example
#include <iostream>
 
int main()
{
    int x = ONE;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY ONE;
    std::cout << x << std::endl;
}

 

Or even worse:

 
#define ONE     +0x001
#define TWENTY  +0x020
#define HUNDRED +0x100

#2Cornstalks

Posted 18 March 2013 - 09:41 PM

It could be worse if they did something like:

 

#define ONE     +1
#define TWENTY  +20
#define HUNDRED +100
 
// Here's a little example
#include <iostream>
 
int main()
{
    int x = ONE;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY ONE;
    std::cout << x << std::endl;
}

 

Or even worse:

 
#define ONE     +0x001
#define TWENTY  +0x020
#define HUNDRED +0x100

#1Cornstalks

Posted 18 March 2013 - 09:40 PM

It could be worse if they did something like:

 
#define ONE     +1
#define TWENTY  +20
#define HUNDRED +100
 
// Here's a little example
#include <iostream>
 
int main()
{
    int x = ONE;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY ONE;
    std::cout << x << std::endl;
}

PARTNERS