Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ syntax error when declaring an array of bytes

Im trying to declare an array of bytes so I can go through them and use each one of them seperatly. This is the array

const BYTE keybyte[] = {
    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
    0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
    0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57 0x58,
    0x59, 0x5A, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
    0x36, 0x37, 0x38, 0x39, 0x25, 0x27, 0x26, 0x28,
    0x0D, 0x20, 0x10, 0x11, 0x12, 0x18};

For some reason when I compile it gives me these errors :/

error C2143: syntax error : missing '}' before 'constant'
error C2143: syntax error : missing ';' before 'constant'
error C2059: syntax error : 'constant'
error C2143: syntax error : missing ';' before '}'
error C2059: syntax error : '}'

I dont understand because if I replace it with

const BYTE keybyte[] = {0,0,0,0};

it works perfectly fine with no errors :/?

like image 534
Ethan Shulman Avatar asked Sep 01 '26 23:09

Ethan Shulman


1 Answers

You are missing a comma between 0x57 and 0x58.

like image 81
Alexander Gessler Avatar answered Sep 03 '26 13:09

Alexander Gessler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!