dickiebird
Programmer
Hi Guys
I want to pass the pointer of a struct item, to a function :
Which do I use ( and why, if you've time to explain) ?
1. format_group_code(&rec->agent_group);
2. format_group_code(&rec.agent_group);
3. format_group_code(rec->agent_group);
typedef struct
{
char header[4];
char agent_code[6];
char old_s4[3];
char new_s4[3];
} B1_REC;
format_group_code(char *group_code)
{
char tmp_group1[6], tmp_group2[6], *cp;
memcpy(tmp_group1, group_code, sizeof(tmp_group1) - 1);
.
.
.
return
}
TIA
Dickie Bird (-)))
I want to pass the pointer of a struct item, to a function :
Which do I use ( and why, if you've time to explain) ?
1. format_group_code(&rec->agent_group);
2. format_group_code(&rec.agent_group);
3. format_group_code(rec->agent_group);
typedef struct
{
char header[4];
char agent_code[6];
char old_s4[3];
char new_s4[3];
} B1_REC;
format_group_code(char *group_code)
{
char tmp_group1[6], tmp_group2[6], *cp;
memcpy(tmp_group1, group_code, sizeof(tmp_group1) - 1);
.
.
.
return
}
TIA
Dickie Bird (-)))