I'm new to c++. I'm using visual studio professional. I'm using Allegro library to make a game. When I ac开发者_JAVA技巧cess an Allegro type or an std; type, intelisense shows me the members. for instance if I do buffer-> it brings up a rectangle listbox of all the class members. But when they are my types it does not work.
I made a struct called PLAYER
struct PLAYER{
int age;
int health;
bool isdead;
};
so then I expected that if I did:
PLAYER *player;
player.
that I would see the members. I tried :: , . , and -> but none work. Where am I going wrong? If I do player.health = 100; it compiles but intellisense doesnt pick up on it.
Thanks
Intellisence need to add your types in its database (file [YourSolution].ncb). Sometimes Intellisence can not add them so you need to:
- Close Visual Studio,
- Delete the .ncb file near to your solution file (.sln) cause your problem may be due to a corrupted file,
- Re-start Visual Studio. Intellisense will take some times to recreate all its database. Those time your type should be recognized.
close and then reopen your VS, then try again.
精彩评论