Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between const and static const

Status
Not open for further replies.

RichardF

Programmer
Oct 9, 2000
239
0
0
GB
Hi,

Is there any difference or benefit between the following :

static const int MyConstant = 99;

or

const int MyConstant = 99;


Thanks in advance,
Rich.

"Programmers are tools for converting caffeine into code - BSRF"
 
If I remember correctly, declaring a global static will only make it global in the file you are in. Extern will not be able to get at it where as the non-static can be accessed with "extern"

matt
 
Ok thanks,

I am presuming that either way makes no difference to the performance of the app.

Rich.

"Programmers are tools for converting caffeine into code - BSRF"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top