Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ Project, need all the help i can get!
#22
have you tried just writing another fuction that has 4 parameters with the same name?(so 2 floodlights create 4 parameters) so that when a function recieves 4 parameters, it knows when to use the second function and not the first


e.g

Function1(parameter, parameter)
{
//do stuff here
}

Function1(parameter, parameter, parameter, parameter)
{
//do stuff here, longer than above
}


is legal syntax for a function.


ALTERNATIVELY(probably youll end up using this way)

use an if statement that checks to see if measurement 3 and 4 are NOT a sentinel value(e.g initialize the data to a sentinel value like -1)
e.g

if(measure3 != -1) distance(measure3, measure4);// if measure3 is NOT the sentinel value, do the calculation of distance for the other 2 values

of course you may need another variable to hold the second distance value to be used.
Reply


Messages In This Thread
C++ Project, need all the help i can get! - by Dudewitbow - 2014-05-02, 01:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)