Arguments are not being passed correctly -- Please help
Arguments are not being passed correctly -- Please help
- Subject: Arguments are not being passed correctly -- Please help
- From: Berndt Jung <email@hidden>
- Date: Mon, 3 Oct 2005 22:58:44 -0700
Below is a very simple example. The output should, as you may guess
be 300, but the first argument when the function is called always
changes to zero, and the output is 200. The strange thing is that if
compiled and run on the command line, there isn't an issue. Within
xcode 2.0 I get the above behavior. Interestingly, if execution
pauses, via a breakpoint at the comment below, everything works. There
are three files, main.cpp, gzmath.h, and gzmath.cpp:
main.cpp
#include "gzmath.h"
#include <iostream>
int main (int argc, char * const argv[]) {
std::cout << sum3(100.0, 100.0, 100.0) << std::endl; //breakpoint
return 0;
}
gzmath.h
double sum3(double, double, double);
gzmath.cpp
#include "gzmath.h"
double sum3(double x, double y, double z) {
return x + y + z;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden