-3

so i get this conversion problem char to const char. how can i get this code to work? please, don't use pointers because im a newbie and i dont know anything about them... Thanks :)

#include<stdio.h>
#include<string.h>
char a[50];
int power(char a) {
    int b;
    b=0;
    if(strlen(a)-b==0)
    return 0;
    else if(a[b]=='x'){
        return power(a,b+1)+1;
    }
    else{
        return power(a,b+1);
    }
    }

}
int main()
{
  scanf("%s",&a);
  printf("%d",power(a));
  return 0;
}
4

1 に答える 1