Namespaces and pre-processing directives

Megha Murarka megha@poseidontech.com
Fri Apr 4 10:21:00 GMT 2003


Hi All,

The program given below compiles fine.
but if we use the statement ,
int x = MYSPACE::VALUE +1;
 It gives an error. Why is it so ? (when the #define is present inside the
scope of the namespace ) ????
****************************************************************************
**
namespace MYSPACE{
    #define VALUE 50;
};
int main(){
    int x = VALUE + 1;
    return 1;
}

Regards,
Megha







More information about the Gcc-help mailing list