function test(var* num){
*num = 2;
}

var asd=0;
test(&asd);

Just to let you know, a pointer is an address. In this case, an address of a var. So it points to the var. When you say *num, it means whatever is pointed by num, in this case, asd and sets it to 2. And over here: test(&asd), you have to pass the address of asd to the function, or else it just creates a local copy and cannot edit it. Go read up on some ANSI C if you want to truly understand pointers. And, please don't use ent.x if you defined something like ENTITY* ent = ent_create(); Use ent->x. It's standard C, you know.