Hi I'm new to this forum. Sorry if how I present my problem is not the correct way.
What I'm trying to do is pass an array of structures to a function. Here is glimpse of the relevant parts of my code.
Code:
...
void manual_replace ( struct key *key_list, char *txt_p, int size); <-- prototype
...
int main (void)
{
...
struct key{
char encoded;
char decoded;
};
struct key key_list[26];
...
manual_replace(key_list, text, text_size); <-- calling the function
...
return 0;
}
void manual_replace ( struct key *key_list, char *txt_p, int size)
{
printf("%c", key_list[1].encoded);
printf ("%c %d", txt_p[0], size);
getchar();
return;
}
The other arguments work just fine. It's only when I call a part of a struct that I get an error. BTW I can't do anything that is C99 only (class rules ).