ok, here is my problem.
I am using sprintf to write a formatted string. That works fine.
it looks like this:
sprintf(buffer, "%f,%f,%i,%f,%f", user.x, user.y, user.dir, user.xspeed, user.yspeed);
where user is a struct
x is a float
y is a float
dir is a short int
xspeed is a float
yspeed is a float
I am parsing the exact same string using sscanf. And I end up with some crazy values.
sscanf(buffer, "%f,%f,%i,%f,%f", &remote.x, &remote.y, &remote.dir, &remote.xspeed, &remote.yspeed);
remote is another member of the same struct as user
x is never right
y is never right
dir is the only one that works i assume it has to do with the fact that it is the only int
xspeed I haven't even tested
yspeed is the same deal as xspeed
Why does this happen? I see no reason for it to not work