![]() |
| | #1 |
| Registered User Join Date: Apr 2009
Posts: 1
| 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;
}
|
| SleepingUdon08 is offline | |
| | #2 |
| Registered User Join Date: Sep 2007
Posts: 448
| What error? |
| cas is offline | |
| | #3 |
| Banned Join Date: Mar 2009
Posts: 533
| What error are you getting? If it's telling you that struct key is undefined you need to move Code: struct key{
char encoded;
char decoded;
};
__________________ ╔╗╔══╦╗ ║║║╔╗║║ ║╚╣╚╝║╚╗ ╚═╩══╩═╝ |
| ಠ_ಠ is offline | |
![]() |
| Tags |
| array, functions, structs |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help passing nxn array to 2d array. | beglaryanh | C Programming | 2 | 06-06-2009 05:23 PM |
| Dynamic array of structures containing yet another dynamic array of structures | innqubus | C Programming | 2 | 07-11-2008 07:39 AM |
| Creating array of structs | knirirr | C++ Programming | 12 | 06-18-2008 08:30 AM |
| Quick question about SIGSEGV | Cikotic | C Programming | 30 | 07-01-2004 07:48 PM |
| Passing pointers between functions | heygirls_uk | C Programming | 5 | 01-09-2004 06:58 PM |