I need if possible port this function to c++:
static unsigned char bux_code[3] = {0xFC, 0xCF, 0xAB};
void bux_convert(char* buf, int size)
{
int n = 0;
// ----
for (n=0;n<size;n++)
{
buf[n]^=bux_code[n%3];
}
}
What i have done:
$bux_code = array("\xFC", "\xCF", "\xAB");
function bux_convert($string)
{
$size = strlen($string);
for ($n = 0; $n < $size; $n++) {
$string[$n] ^= $bux_code[$n % 3];
}
return $string;
}
var_dump ( bux_convert("£Ì•½Ï¼«ü") );
But i got this error: Cannot use assign-op operators with overloaded objects nor string