-
May 13th, 2010, 08:18 AM
#1
#define vs const - where to use #define?
As a newcomer to programming and C++, I wondered what the difference between:
#define SIZE 10
and
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?
Thanks!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|