You're still allowed to do this, of course:
Code:// x.hpp extern const int &x; // x.cpp int real_x; const int &x = real_x;
You're still allowed to do this, of course:
Code:// x.hpp extern const int &x; // x.cpp int real_x; const int &x = real_x;
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
As I said, both files at the same time and -combine:
Code:gcc -o const -combine const1.c const2.c
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
You can't use gcc to compile c++ programs. I see that I did .c instead of .cpp, sorry about that.
Both gcc and g++ gave me "unrecongized option `-combine`". Changing cout to printf and compiling both as C gave me a working program.
IMO it is pretty silly to have that be undefined behavior but oh well.
Yes, you can. And it was me who changed the names to .c, because -combine is not implemented for C++.You can't use gcc to compile c++ programs.
I don't know what GCC version you have. Mine is 4.1.2.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
3.something. Haven't had a need to update it. When I compiled the files using gcc I got syntax errors because of std::.
#macros are beautiful
so sweetCode:#define IF if( #define THEN ) { #define ENDIF } #define MARRY_GO_ROUND while(1) {;}
Code:IF 5 == 5 THEN MARRY_GO_ROUND ENDIF