• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Arguments are not being passed correctly -- Please help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Arguments are not being passed correctly -- Please help
      • From: Markian Hlynka <email@hidden>
    • Re: Arguments are not being passed correctly -- Please help
      • From: Berndt Jung <email@hidden>
  • Prev by Date: Re: gmalloc prevents a "Bus error"
  • Next by Date: Re: How do I build universal binaries for libraries with endian-specific code
  • Previous by thread: Re: just C++ in xcode
  • Next by thread: Re: Arguments are not being passed correctly -- Please help
  • Index(es):
    • Date
    • Thread