passing struct to function
Hello all! I'm creating a Win32 App using MSVC++ 6 compiler.
I'm looking for help because I don't understand why I am getting these errors. I've been reading up on structs in C ... but it hasn't clicked yet. I'm returning pVect so I can use it later in another function and it will be called more than once. I think i'm doing something wrong with my struct, but I cannot pinpoint it from here...is there a better way to pass a struct or use pointers in a different way...so confusing =[
Code:
struct vect2d
{
float h;
float v;
};
Code:
float getMouse(struct vect2d mVect)
{
float One0;
float One1;
mVect.h = ReadProcessMemory(hand, (void*)0x402AD4B8, &One0,4, &bytes);//169
mVect.v = ReadProcessMemory(hand, (void*)0x402AD4BC, &One1,4, &bytes);//170
return mVect;//171
}
Code:
main.c(169) : warning C4244: '=' : conversion from 'int ' to 'float ', possible loss of data
main.c(170) : warning C4244: '=' : conversion from 'int ' to 'float ', possible loss of data
main.c(171) : error C2115: 'return' : incompatible types