qt-interest@trolltech.com
[Top] [All Lists]

Re: Global const in C++

Subject: Re: Global const in C++
From: Anton I Alferov
Date: Tue, 07 Nov 2006 02:22:31 +0300
Oleg Romanenko wrote:
Bjoern Schliessmann wrote:
Oleg Romanenko wrote:


Hello, I'm a bit off from Qt, but how can I declare and use a
global const in my program?


What's wrong about

const int myConstInt = 4;

...?

I need to use this global variable in all building blocks (cpp's) in my program. When I try to use extern in each CPP file -> I get linker error.


Regards,


Björn

I haven't any troubles declaring any extern const variables and use them in all cpp's in program after. Qt is just library, and such linker error does not depends of using it.
--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/



--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>