|
Author |
Message |
kepler
Junior WebHelper
Joined: 08 Feb 2002
Posts: 37
|
Posted:
Tue Oct 19, 2004 1:18 pm (20 years ago) |
|
Hi,
I'm trying to create a simple array in a C file. It goes something like this:
Code: |
int NCON=89;
/*#define NCON 89*/
char *constel[89] = {
"And Andromedae",
(etc...)
"Vul Vulpeculae",
}; |
But when I call for constel[number] ( constel[7], for example) I get a null value. The same thing happens with another array I have:
Code: |
/*#define NBNDRIES 357*/
int NBNDRIES = 357;
long bndries[4*357] = {
0L, 86400L, 316800L, 84L,
28800L, 52200L, 311400L, 84L,
(etc...)
0L, 86400L, -324000L, 58L,
}; |
What am I doing so obviously wrong?
Regards,
Kepler |
Last edited by kepler on Tue Oct 19, 2004 1:39 pm, edited 1 time in total |
|
|
|
kepler
Junior WebHelper
Joined: 08 Feb 2002
Posts: 37
|
Posted:
Tue Oct 19, 2004 1:38 pm (20 years ago) |
|
I removed the "*" from constel. Now I get the error: excess elements in char array initializer - but I've counted - it's correct.
Regards,
Kepler |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Wed Oct 20, 2004 2:20 pm (20 years ago) |
|
Code: | long bndries[4*357] = { |
I don't think you can do mathematical operations there. |
________________________________ It's turtles all the way down... |
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.165871 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |