Guest - Caio - Posted December 1, 2006 Report Share Posted December 1, 2006 Como eu faço o XOR logico??Eu tenho uma variavel do tipo CHAR e quero fazer um XOR nelaExemplo:para fazer um AND eu faço o seguinteminhavariavel = minhavariavel & 0x02;ouminhavariavel &= 0x02;mas eu tento usarminhavariavel ~= 0x02;e da o seguinte erro:ERROR: Syntax error before '~' tokenCompilador GCCsistema Slackware 11 Quote Link to comment Share on other sites More sharing options...
0 Denis Bittencourt Muniz Posted December 1, 2006 Report Share Posted December 1, 2006 ^ (operador XOR Bit-a-Bit)Como eu faço o XOR logico??Não existe, já que em uma operação XOR é obrigado à avaliação de ambos operandos.~=Não existe esse operador. Existe o operador ~ (NOT Bit-a-Bit).Falows! Quote Link to comment Share on other sites More sharing options...
0 Guest Visitante Posted December 2, 2006 Report Share Posted December 2, 2006 aii, muito obrigada, eu tinha feito uma confusão :Dxauzin Quote Link to comment Share on other sites More sharing options...
0 Guest Visitante Posted December 2, 2006 Report Share Posted December 2, 2006 *obrigado Quote Link to comment Share on other sites More sharing options...
Question
Guest - Caio -
Como eu faço o XOR logico??
Eu tenho uma variavel do tipo CHAR e quero fazer um XOR nela
Exemplo:
para fazer um AND eu faço o seguinte
minhavariavel = minhavariavel & 0x02;
ou
minhavariavel &= 0x02;
mas eu tento usar
minhavariavel ~= 0x02;
e da o seguinte erro:
ERROR: Syntax error before '~' token
Compilador GCC
sistema Slackware 11
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.