Can't change text in a struct? O.o
Posted: Tue Nov 18, 2014 9:50 pm
For some reason game-editor keeps crashing when ever I try to change any text-based values inside a struct. For example:
I have a reason for using structs, and there's more variables inside the struct I just shortened it for the example. When ever I try to use sprintf, it crashes, when I use strcpy, nothing gets written O.o...
^ This part crashes it, trying to display the text.
^ This doesn't do anything O.o... Or if it does, I'm not able to display the output.
- Code: Select all
typedef struct {
char*player_name;
}profile;
I have a reason for using structs, and there's more variables inside the struct I just shortened it for the example. When ever I try to use sprintf, it crashes, when I use strcpy, nothing gets written O.o...
- Code: Select all
strcpy(text, player_profile.player_name);
^ This part crashes it, trying to display the text.
- Code: Select all
strcpy(player_profile.player_name, "example...");
^ This doesn't do anything O.o... Or if it does, I'm not able to display the output.