hi,is it possible to pass a structure element by reference or do you have to pass the whole structure?Googled it and just got passing the structure it self by reference.
tried returning an element via a function but keep getting errors for the function definition.
Code:
int hullDam(sShip & playerShip.hull)
{
return playerShip.hull=playerShip.hull-10;
}
and here's the error report
Code:
my documents\visual studio 2008\projects\test\test\test.cpp(12) : error C2143: syntax error : missing ',' before '.'
c:\documents and settings\xxxxxxx\my documents\visual studio 2008\projects\test\test\test.cpp(14) : error C2440: 'return' : cannot convert from 'int' to 'sShip'
No constructor could take the source type, or constructor overload resolution was ambiguous