B
ben
hello there,
oh dear, oh dear.
here's a non global array of strings:
char *chararray[] = { "abc", "defgh", "ijklmop" };
how do i do that so chararray is global? what goes in a .h file and
then what goes in a .c file's function? i've just tried a whole load of
things but just couldn't do it.
i may have a slightly separate and related problem/misunderstanding
which may be why i can't do the above:
i have the following in a .h file:
unsigned Value;
and the following in a .c file in a function:
Value = 0;
the .h file is included from various .c files and when i compile i get
ld: multiple definitions of symbol _Value
first, "unsigned Value;" is *not* a definition right? it's a
decleration but i can't help feel that the compiler, when it says
"multiple definitions", is talking about the "unsigned Value;" part
rather than the "Value = 0;" part. i'm a bit confused about files
including headers
this is actually an objective-c project and when i say ".c" above i'm
lying. it's in a .m file but apparently i'm told this is totally a c
issue not objective-c.
can anyone offer me any help regarding this please?
thanks, ben.
oh dear, oh dear.
here's a non global array of strings:
char *chararray[] = { "abc", "defgh", "ijklmop" };
how do i do that so chararray is global? what goes in a .h file and
then what goes in a .c file's function? i've just tried a whole load of
things but just couldn't do it.
i may have a slightly separate and related problem/misunderstanding
which may be why i can't do the above:
i have the following in a .h file:
unsigned Value;
and the following in a .c file in a function:
Value = 0;
the .h file is included from various .c files and when i compile i get
ld: multiple definitions of symbol _Value
first, "unsigned Value;" is *not* a definition right? it's a
decleration but i can't help feel that the compiler, when it says
"multiple definitions", is talking about the "unsigned Value;" part
rather than the "Value = 0;" part. i'm a bit confused about files
including headers
this is actually an objective-c project and when i say ".c" above i'm
lying. it's in a .m file but apparently i'm told this is totally a c
issue not objective-c.
can anyone offer me any help regarding this please?
thanks, ben.