[Coco] help me out please

Mark McDougall msmcdoug at iinet.net.au
Thu Feb 18 17:33:02 EST 2010


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!"



More information about the Coco mailing list