I am developing a function that is in the form of:
int functionname(float);
int functionname(float var)
{
return someint;
}
I have a driver that calls this function with a float. The problem is that whatever I passed in get's screwed with. IE I call it with 5.67 and when I print var inside the function it comes out as 2.34... I took out everything except the print statement to make sure that it wasn't something else, but it would still print out bogus numbers. Then I put the declaration and definition inside the driver and it worked. Anybody know what could cause this to happen? I showed my professor and she didn't know what was going on either.
int functionname(float);
int functionname(float var)
{
return someint;
}
I have a driver that calls this function with a float. The problem is that whatever I passed in get's screwed with. IE I call it with 5.67 and when I print var inside the function it comes out as 2.34... I took out everything except the print statement to make sure that it wasn't something else, but it would still print out bogus numbers. Then I put the declaration and definition inside the driver and it worked. Anybody know what could cause this to happen? I showed my professor and she didn't know what was going on either.