pointers in structures..

Why are all my pointers inside structures out of scope?
I am really tired right now and my head is splitting from six months of stress(not over this problem just various other things lol). Anyway can someone help me out by figuring out whats wrong with this class: its just a prototype to figure out why I can't get the feature to work in a more complex program I am making.:

#include <iostream>
struct foo {
int *bar;
};

int main() {
foo foobar;
foobar.bar = new int;
foobar.*bar = 12;
return 0;
}

Thanks
*foobar.bar=12;
Last edited on
Well can you explain what really you want to output in your program.Detailed explanation please i hope i could help...
Topic archived. No new replies allowed.