meow00
asked on
C++ : declaration ? definition ? alias ?
To C++ expert ?
Is "extern float a" a declaration ?
Is the "namespace mystd = std" a declaration ? definition ? or alias ?
Also, is the "tydef unsigned char byte" a declaration ? definition ? or alias ?
Thanks a lot !
meow .....
Is "extern float a" a declaration ?
Is the "namespace mystd = std" a declaration ? definition ? or alias ?
Also, is the "tydef unsigned char byte" a declaration ? definition ? or alias ?
Thanks a lot !
meow .....
ASKER
I am sort of confused here .... because based on
"C++ in a nutshell" p24 and p28 .... typedef is only a declaration ?? I don't know if I miss understand it here.....
since this original question ask which of the three is a definition.... then I don't know if "namespace = std" a definition
or not ... ?
thanks.
"C++ in a nutshell" p24 and p28 .... typedef is only a declaration ?? I don't know if I miss understand it here.....
since this original question ask which of the three is a definition.... then I don't know if "namespace = std" a definition
or not ... ?
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
--------------------------
extern float a;
This is a declaration, because you don't initialize the value of a.
--------------------------
namespace mystd = std;
This way you make an alias of the namepace. Compare it to this:
namespace mynamespace
{
...
}
Here the namespace is both declared and defined.
--------------------------
typedef unsigned char byte;
It is a type definition and has nothing to do with variable, function etc. declarations/definitions or namespace aliases.