-
class/struct error ? :(
I am having problems putting a variable of a class inside a struct
Item_Class (is my class)
Code:
struct player
{
int hp;
Item_Class items;
};
that is my structure as soon as the "Item_Class" is put inside the struct it pulls up a string error, if I declare it outside of the struct it runs perfectly. Why is that?
-
maybe the structs/classes clash so that they dont work together.
Have you tried having them both as classes?
-
I dunno, when I did it, it worked fine. Post your code.
-
okay the error now doesn't occur until I exit the program. here is the error message.
Project project.exe raised exception class EAccessViolation with message 'Access violation at address 00401672. Read of address FFFFFF91'. Proccess stopped.
It stops and then goes to the string_r.h line 194
-
but it doesn't occur if I don't have the class inside the structure
-
>'Access violation at address 00401672. Read of address
>FFFFFF91'
Why the hell cant they have normal errors?