#include <stdio.h>
void square(char x)
{
printf("Enter x again: "); //the code stops after printing this line**
scanf("%c", &x);
printf("%c", x);
}
int main(void)
{
char x;
printf("Enter x: ");
scanf("%c", &x);
square(x);
return 0;
}
I want the code to take input in the square function, but it stops before that. I know if i use another variable instead of x in the function it will probably work but i want to reuse this variable.