Char array strings problem
First the code:
Code:
typedef struct {
char *data_string
} obs
int string_to_num(char string_in, int *string_out)
{
char *temp;
temp = malloc((strlen(string_in)+1) * sizeof(char));
strcpy(temp, &qstring_in);
if (*temp == 'P') /* Test Passed. */
*string_out = 1;
return 0;
}
problem is in my code I refer to a data pointer that points to the structure and -> to the data_string.
I don't know how to pass it as an argument into string_to_num() as its not a char but a pointer...
Does that make sense?