[Coco] help me out please
Bob Devries
devries.bob at gmail.com
Thu Feb 18 18:53:42 EST 2010
Thanks, guys,
Mark was of course, correct. I should have made the declaration global. With
that it compiles correctly.
I knew I'd made a simple mistake, but couldn't see it.
Regards, Bob Devries
--
Besides a mathematical inclination, an exceptionally good mastery of one's
native tongue is the most vital asset of a competent programmer.
Edsger W.Dijkstra, 18 June 1975
----- Original Message -----
From: "Mark McDougall" <msmcdoug at iinet.net.au>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Friday, February 19, 2010 9:33 AM
Subject: Re: [Coco] help me out please
> Bob Devries wrote:
>
>> char *ending[4]={"th","st","nd","rd"};
>
>> For the life of me I can't remember the work-around. I believe this to be
>> a limitation in the K & R compilers. Sadly I'm without almost all my
>> reference books here in the Philippines.
>
> In K&R C, only static and global arrays can be auto-initialised. And you
> can also omit the array size in the declaration, which improves
> maintainabilty.
>
> I'm going to take a stab in the dark here, but purely from the code
> snippet you have given, I suspect that "ending" is actually const and
> should probably be global/static anyway?!?
>
> Regards,
>
> --
> | Mark McDougall | "Electrical Engineers do it
> | <http://members.iinet.net.au/~msmcdoug> | with less resistance!"
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list