P
Panda2
Say I have a structure such as:
struct Barn{
char type[10];
int number;
}animal[100]
so for example we might have data like
animal[0].type cow
animal[0].number 10
I want to pass this structure to another function where i might want to
do:
animal[0].number++
animal[1].number=5 (which say might be dogs... )
etc......
I'm really struggling to work out how to do this without making a
global declaration of the structure..
So, any thoughts on how to do this???
Thank-you
struct Barn{
char type[10];
int number;
}animal[100]
so for example we might have data like
animal[0].type cow
animal[0].number 10
I want to pass this structure to another function where i might want to
do:
animal[0].number++
animal[1].number=5 (which say might be dogs... )
etc......
I'm really struggling to work out how to do this without making a
global declaration of the structure..
So, any thoughts on how to do this???
Thank-you