• 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
Re: C++ PLEASE HELP
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ PLEASE HELP


  • Subject: Re: C++ PLEASE HELP
  • From: Steve Checkoway <email@hidden>
  • Date: Sat, 28 Oct 2006 21:07:55 -0700


On Oct 28, 2006, at 8:44 PM, valery gaulin wrote:

Can somebody help me out with this c++ program that I am writting for my first c++ course.
Basically this assignment ask us to create an array from the user and build some function find max, min, sum, etc. My code seems to be fine in my main program but it does not cout these line:

The purpose of this list isn't really to give c++ help.

cout<< " The array is : ";
print(a,i);

and it always cout min=0 at this line, wich it should give me the smallest value:

cout<< "The minimum value index position is: " << find_minimum (a,i,min) << " and the number is: " << min << endl;

Is it possible that the compiler xcode as some defect or is it me that is making a mistake? I attach my program and here are the output from my program when I enter some integer. Please some one answer me, because I really don't understand what is wrong.

The min always being zero issue has to do with order of evaluation. Someone recently told me that the order in which the operands to an operator are evaluated is undefined in c++. In this case, min is initialized to zero and is likely being evaluated before find_minimum () is.



-- Steve Checkoway



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >C++ PLEASE HELP (From: "valery gaulin" <email@hidden>)

  • Prev by Date: C++ PLEASE HELP
  • Next by Date: Re: Apple's Tools Strategy
  • Previous by thread: C++ PLEASE HELP
  • Next by thread: What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"?
  • Index(es):
    • Date
    • Thread