Try if this works..
class Ball {
static const int radius;
};
const int Ball :: radius=10;
--- On Sun, 28/2/10, Tyler Littlefield <[email protected]> wrote:
From: Tyler Littlefield <[email protected]>
Subject: Re: [c-prog] Non integral type class constant - How?
To: [email protected]
Date: Sunday, 28 February, 2010, 5:29 AM
Thanks,
Tyler Littlefield
http://tds-solutions.net
Twitter: sorressean
On Feb 27, 2010, at 4:57 PM, Olufowobi Lawal wrote:
> >I need to achieve class constant for integral type
> Awesome. And? What is the problem? Why can't you just use const? We need more
> than one sentence telling us part of what you want.
> ________________________________
>
> class Ball{
> static const int radius = 10;
> };
>
> I have tried,
> class Ball
> {
> const static double radius ;
>
> };
> Ball::radius = 10.0;
>
> ________________________________
>
> I get an "unresolved external symbol" linker error.
>
> Any other way, this can be achieved?
> Thanks,
> Olufowobi Lawal
>
> [Non-text portions of this message have been removed]
>
>
------------------------------------
To unsubscribe, send a blank message to
<mailto:[email protected]>.Yahoo! Groups Links
Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!
http://downloads.yahoo.com/in/internetexplorer/
[Non-text portions of this message have been removed]