I have a struct and I want to copy the elements in the outfname of orig to the outfname of dest. How can I do this?
typedef struct {
char outfname[256];
} sudoku_t;
void sudoku_copy(sudoku_t* orig,sudoku_t* dest){
}
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
just use the assignment operator.
As a side-note I suggest you to use
destas the first parameter in your function to align with the C convention used by functions likememcpyandstrcpy.