Namespace usage

zhaozj2021-02-16  97

If you can use a lot of current categories that WTL in the MFC program at the same time, how much.

In order not to take the MFC CBitmapButton conflict, don't look at Namespace's truth.

This is described in MSDN:

The C language only provides a single Namespace, which has problems, for example:

// one.h char func (char); class string {...}; // Somelib.h class string {...};

Such definitions are not possible, causing the String class to crash.

So a NameSpace has declated a zone and adds an identifier to this area, making a tag for each Name in this area. So we just

You can use the same name without worrying to have a conflict. Instant Name appears in the same translation unit, as long as there are different namespace

It is independent of each other, for example:

// one.hnamespace one {char func (char); class string {...};

// Somelib.hnamespace Somelib {class string {...};

String will not collapse, because one :: string and somelib :: string are independent of each other.

So how should I use CBITMAPBUTTON at the same time?

转载请注明原文地址:https://www.9cbs.com/read-10602.html

New Post(0)