#include <stdio.h>
void escolha_simb(char *jog1, char *jog2) {
while (1) {
printf("\njogador 1, escolha X ou O \n"); char esc;
if (esc == 'x') {
*jog2 = 'X';
*jog1 = 'O';
break;
}
else if (esc == 'o') {
*jog2 = 'O';
*jog1 = 'X';
break;
}
}
}
int main() {
char jog1 = 0, jog2 = 0;
printf("jog1: %c jog2: %c", jog1
, jog2
); escolha_simb(&jog1, &jog2);
printf("depois\njog1: %c jog2: %c", jog1
, jog2
); }
//https://pt.stackoverflow.com/q/346035/101
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGVzY29saGFfc2ltYihjaGFyICpqb2cxLCBjaGFyICpqb2cyKSB7CiAgICB3aGlsZSAoMSkgewogICAgICAgIHByaW50ZigiXG5qb2dhZG9yIDEsIGVzY29saGEgWCBvdSBPIFxuIik7CiAgICAgICAgY2hhciBlc2M7CiAgICAgICAgc2NhbmYoIiVjIiwgJmVzYyk7CiAgICAgICAgaWYgKGVzYyA9PSAneCcpIHsKICAgICAgICAgICAgKmpvZzIgPSAnWCc7CiAgICAgICAgICAgICpqb2cxID0gJ08nOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoZXNjID09ICdvJykgewogICAgICAgICAgICAqam9nMiA9ICdPJzsKICAgICAgICAgICAgKmpvZzEgPSAnWCc7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KfQoKaW50IG1haW4oKSB7CiAgICBjaGFyIGpvZzEgPSAwLCBqb2cyID0gMDsKICAgIHByaW50Zigiam9nMTogJWMgam9nMjogJWMiLCBqb2cxLCBqb2cyKTsKICAgIGVzY29saGFfc2ltYigmam9nMSwgJmpvZzIpOwogICAgcHJpbnRmKCJkZXBvaXNcbmpvZzE6ICVjIGpvZzI6ICVjIiwgam9nMSwgam9nMik7Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzM0NjAzNS8xMDE=