May 13th, 2010, 09:18 AM
#define vs const - where to use #define?
As a newcomer to programming and C++, I wondered what the difference between:
#define SIZE 10
const int SIZE=10
From doing my own research, I understand the differences between the 2 (one is done by pre-processor, one by compiler, etc) and it seems in every case the "const int" method is preferable.
So I'm now wondering when should #define be used, if ever?
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!