468,463 Members | 2,026 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,463 developers. It's quick & easy.

What does "expected unqualified-id before numeric constant" mean?

In my app, there is a namespace definition.

....
namespace CMD {
...
const int YT_UP = 1; // line 149
...
};

g++ tells expected unqualified-id before numeric constant error at
line 149.
I change it to be

namespace CMD {
...
const int YT_UP1 = 1; // line 149
...
};

It compiles ok.

So is there name collision for YT_UP?
Dec 25 '07 #1
1 43693
Allen wrote:
:: In my app, there is a namespace definition.
::
:: ...
:: namespace CMD {
:: ...
:: const int YT_UP = 1; // line 149
:: ...
:: };
::
:: g++ tells expected unqualified-id before numeric constant error at
:: line 149.
:: I change it to be
::
:: namespace CMD {
:: ...
:: const int YT_UP1 = 1; // line 149
:: ...
:: };
::
:: It compiles ok.
::
:: So is there name collision for YT_UP?

Probably.

All uppercase names are often used for preprocessor macros, which
doesn't respect namespace scopes. Therefore such names should
generally be avoided for everything else.

Bo Persson
Dec 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Geoff Jones | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.