I tried a code like this

#include <stdio.h> 
int main()
{
    enum a { b, c, d, e,}f;
    printf("The stack top is near %p\n", &(f = e) );
    return f;
}

and got message :
error: lvalue required as unary ‘&’ operand
I use gcc4.3.2.

and I had tried :

#include <stdio.h> 
int main()
{
    enum a { b, c, d, e,}f;
    f = e;
    printf("The stack top is near %p\n", &f);
    return f;
}

there's no error in this way.

You are in the wrong forum. Post your question in the C++ forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.