I haven't programmed in C for awhile and having an issue with passing a string to a function. The code works however I get warnings from gcc.
I call the function in my main with:
copyToCode(code, section1, section2);
The function is:
void copyToCode (char **code, char *loc, char *data ){}
I get "conflicting types for copyToCode" on the line containing the function and "previous implicit declaration of copyToCode was here" warning on the line calling the function.
I have declared the variables:
char *code = malloc (32*1000* sizeof(char));
char *section1 = malloc(8*sizeof(char)), *section2 = malloc(8*sizeof(char));
I also tried this :
char *section1[8];
As a side question - which is correct?
The section1 and section2 are meant to be Strings, and the code is meant to be an array of strings.
Thanks for reading, I appreciate any help. Gareth