i couldn't get why i can't take a character pls help me:(
#include <stdio.h> #include <stdlib.h> void shiftRightOrLeft(int d[], int size, int n, char direction); int main() { int size,n; char direction; printf("size:"); scanf("%d",&size); int d[size]; int i; printf("dizi elemanlari:"); for(i=0;i<size;i++) { scanf("%d",&d[i]); } printf("n:"); scanf("%d",&n); printf("Enter if Left or Right: "); scanf("%c",&direction); shiftRightOrLeft( d,size, n,direction); return 0; } void shiftRightOrLeft(int d[], int size, int n, char direction) { if(direction=='l') { int temp=d[n-1]; int i; for(i=1;i<size;i++) { d[i-1]=d[i]; } d[size-1]=temp; int m; for(m=0;m<size;m++) { printf("%d",d[m]); } } else if(0==strcmp(direction,"r")) { int temp2=d[size-n]; int i; for(i=1;i<size;i++) { d[i]=d[i-1]; } d[0]=d[size-n]; } int k; for(k=0;k<size;k++) { printf("%d",d[k]); } }