I can't find any solution to my problem and my brain is almost exploding...
I have defined a struct and a function to create contacts, like a adress book. I'm asking how many contacts want to be created and this totally works fine.
So I end up with an array of Contacts which pointer i give to my menue. In my menue I can choose to create a contact, search and delete a contact.
Currently I'm working on searching a contact. So I start the search function and give it the pointer on my Struct.
I have no clue how to dereference this pointer into an array of structs again. It's probably just a stupid small little error, but I can't find it.
So I first tried to find out how many Contacts I created. When I try to print the number of created contacts like this:
void searchContact(struct Contact* ContactArray){
int howManyContacts=sizeof(ContactArray)/sizeof(struct Contact);
printf("%d",howManyContacts);
}
I always get 0 printed out. Doesn't matter if I create 1,2,3....Contacts
I hope someone of you can help me...It's driving me crazy
By the way, I'm using Eclipse with GCC compiler