• Create Account

We're offering banner ads on our site from just \$5!

#ActualCornstalks

Posted 18 March 2013 - 09:44 PM

#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