Create a pointer of a struct which is inside a class

Hi, I want to create a pointer of a struct in a function, func, which is in my main.cpp. The struct is a private member of class Foo, but the function, func, is a friend of class Foo. So I have no trouble getting states directly from Foo. But I just can't create a struct.

I in function im trying like, (say struct name is item)

1
2
3
4
void func()
{
    struct Foo::item* i = new item;
}


My error says:
expected a type specifier before 'ítem'
Last edited on
closed account (48bpfSEw)
1
2
3
4
5

void func()
{
    struct Foo::item* i = new FOOOOO::item;   // ^^
}
@Necip, I knew I was doing something silly. Thanks a lot!
Topic archived. No new replies allowed.