lundi 2 mars 2015

Double backslash in comment inside array


I have an array defined as follows:



extern const char config_reg[] = {
0x05, //comment
0x00, //comment
0x00, // \\ <-- double backslash
0x01, //comment
0x03
}


As you can see, there is a double backslash inside a comment (the <-- double backslash and preceding spaces do not appear in the actual source file). When I compile this code (minus the "<-- double backslash") it acts as if the following line is non existent - i.e. equivalent to writing:



extern const char config_reg[] = {
0x05, //comment
0x00, //comment
0x00, //

0x03
}


Is this intended C++ behaviour? If so, what is its intended purpose?


I am compiling using the Parallax Propeller Simple IDE to compile my code - not a particularly good compiler, by all accounts. Is it likely that the compiler implementation is causing this behaviour?




Aucun commentaire:

Enregistrer un commentaire