I don't know why program is crashing and on build message i have
"warning: passing arg 1 of 'strcmp' makes pointer from integer without a cast"
I want to compare first character of every string to "_" and if it is "_" exit the loop
Here is my code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int i,j;
char a[20][4];
char *pa[20];
for (i=0; i<20; i++)
{
pa[i]=&a[i][0];
}
for (i=0; i<20; i++)
{
scanf("%s",&a[i][0]);
if (strcmp(*(pa[i]+0),"_")==0)
{
printf("ok");
}
}
for (i=0; i<20; i++)
{
for (j=0; j<4; j++)
{
printf("%c",*(pa[i]+j));
}
}
return 0;
}