|
|
|
|
|
by klingonopera
2310 days ago
|
|
> "Using the "+" operator with two string constants gives a weird compiler error about adding pointers?" He'd have that in C too, and that's the expected behaviour. What he would want is: #define STRING1 "hello"
#define STRING2 "world"
const char* gString = STRING1 " " STRING2 "!\n";
#include <stdio.h>
int main() {printf(gString); return 0x0;}
|
|
This is all due to C compatibility.