I coded this:
Qt Code:
  1. setInput(double* d) {
  2. cout << " *d0 " << d[0] << " " << "*d1 " << d[1] << endl;
  3. for (int i=0; i < _num_input; ++i)
  4. _input[i] = d[i];
  5. }
  6.  
  7. main () {
  8. double input[2] = {4.50, 3.10};
  9. double sum=0;
  10. sum = input[0] + input[1];
  11. for (uint i=0; i < 2; i++)
  12. setInput (input);
  13. cout << "input[0,1] " << input[0] << " " << input[1] << " " << sum << endl;
  14. }
To copy to clipboard, switch view to plain text mode 
Output is:
Qt Code:
  1. *d0 4.5 *d1 3.1000000000000001 //why this '1' at the end???
  2. input[0,1] 4.5 3.1000000000000001 7.5999999999999996
To copy to clipboard, switch view to plain text mode 
what's that '1' ???? why does it appear only after setInput() call??
thanks