This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
////// namespace.hh ////// #ifndef NAMESPACE_HH #define NAMESPACE_HH
namespace Name { static const char charA = 'A'; const char charB = 'B'; extern const char charC; extern char charD; };
////// namespace.cc ////// //#include "namespace.hh"
const char Name::charC = 'C'; char Name::charD = 'D';
////// main.cc ////// #include <stdio.h> //#include "namespace.hh"
int main() { printf("charA = %c\n", Name::charA); printf("charB = %c\n", Name::charB); printf("charC = %c\n", Name::charC); printf("charD = %c\n", Name::charD);
Attachment:
PGP.sig
Description: This is a digitally signed message part
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |