A friend tells me that in C when u malloc a char array u have to allocate length of the string + 2 (1 for the '\0' and 1 cause C needs it for some reason, i forget why tho). Just windering if this is...
Type: Posts; User: St. Jimmy
A friend tells me that in C when u malloc a char array u have to allocate length of the string + 2 (1 for the '\0' and 1 cause C needs it for some reason, i forget why tho). Just windering if this is...
I just thought of this, so I'm not sure if it will work but
char *str, *tmp, *ptr;
strcpy(str,"a string example");
//lets remove the x in 'example' from this string
//x is located at...
if anyone is interested i got a solution to the problem. I take no credit for this, a friend and my dad were the brains behind it, but it makes sense if u think about it.
the variable that i send...
I got rid of the initialization since the value that is stored gets changed at the start of each function that need it. It worked to I don't get that warning.
Thank you for your explaination.
i declare it
extern int compflag =0; and there is no other declaration of it elsewhere.
hey,
in another function that I call to get the record i allocate the memory for the tags[][3] and i check and it works. I am not allowed to change the parameters for this function, If I could I...
I get a warning when i declare a global integer variable extern?
extern int compflag
but when initialize a char variable extern from some old code i found I don't have the same warning....
Ok, so i have a function that has passed to it
REC *(**recs)[].
Which i see as a pointer to a pointer of an array of pointers :rolleyes:
Where REC is a structure with
struct REC{