I am trying to read data in to a struct from a prototype
My Code is:
My complier is saying this:
error C2198: 'strcpy_s' : too few arguments for call
warning C4047: 'function' : 'rsize_t' differs in levels of indirection from 'char [30]'
warning C4024: 'strcpy_s' : different types for formal and actual parameter 2
Anyone have any ideas????
My Code is:
Code:
void init(student_record db[],int *count)
{
FILE *input;
char temp_str[30];
input = fopen("mydata.txt","r");
while(!feof(input) && count<SIZE)
{
fscanf_s(input,"%s",temp_str);
strcpy_s(db[*count].firstname,temp_str);
fscanf_s(input,"%s",temp_str);
strcpy_s(db[*count].lastname,temp_str);
fscanf_s(input,"%s",temp_str);
strcpy_s(db[*count].ssno,temp_str);
fscanf_s(input,"%s",temp_str);
strcpy_s(db[*count].city,temp_str);
fscanf_s(input,"%s",temp_str);
strcpy_s(db[*count].state,temp_str);
fscanf_s(input,"%s",temp_str);
strcpy_s(db[*count].year,temp_str);
fscanf_s(input,"%s",temp_str);
strcpy_s(db[*count].sex,temp_str);
fclose(input);
}
}
error C2198: 'strcpy_s' : too few arguments for call
warning C4047: 'function' : 'rsize_t' differs in levels of indirection from 'char [30]'
warning C4024: 'strcpy_s' : different types for formal and actual parameter 2
Anyone have any ideas????
Comment