Original Post
Is there any way to assign a default value to an item within a structure? When I try to compile this, the Dev-C++ tells me "7 C:\dev\structures.cpp ISO C++ forbids initialization of member `magic '" Any way to do this? Thanks, Tom
struct Hero
{
char name[30];
int hitpoints;
int magic = 0;
int speed = 4;
int strength = 5;
} ;