In my code I have separate function to set string elements through a function to the breakerOptions[]
array."time"
is one of the string stored in that array
char * breakerOptions[6];
......
int i=0;
while (i<6){
breakerOptions[i]=(char *)malloc(10);
strcpy(breakerOptions[i],FILE_BREAKER_OPTION_ARRAY[i]);
i++;
}
if (breakerOptions[1]=="time"){
printf("\nYeah first\n");
}
But the thing is that if condition's fails for no reason
Then I put a printf
to check if it's stored.
printf("\nYeah first,%s %d\n",breakerOptions[1],(int)sizeof(breakerOptions[1]))
even thought its there it doesn't work.
I also checked the size of breakerOptions[1]
. It gives me 8.