There are multiple errors in that code.
Firstly, you defined your filename string wrong. "char filename;" defines only one character. You have to use "char* filename;" to create a char array.


Secondly, with "cube.filename = "cube.mdl";" you just create a temporary char array. (This only works when initialising a char array while defining it, but that might not even work in Lite-C either.) It will be invalid in the next line. This is how you should to it:
Code:
cube.filename = malloc(sizeof(char)*number_of_characters_you_need_plus_one);
strcpy(cube.filename,"cube.mdl"); // strcpy, not str_cpy




For your vector, better use VECTOR, instead of VECTOR*. Then you can just set it like this:
Code:
cube.position.x = 0;
cube.position.y = 0;
cube.position.z = 0;



Last edited by Lukas; 12/31/10 11:00. Reason: sizeof(char) instead of sizeof(char*)