Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ PLEASE HELP



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:


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.

[Session started at 2006-10-28 01:32:42 -0400.]
Enter n integer and when you are done press CTRL-D
45
76
23
12
ª
the number of integer that were store in the array is: 4
the sum of all the elements in the array is : 156
The minimum value index position is: 3 and the number is: 0
The maximum value index position is: 1 and the number is: 76
If the target value 42 is not fund it will return (-1) otherwise the index of the target is : -1
The inverted array is: 12, 23, 76, 45,
mainupdate has exited with status 0.


_________________________________________________________________
Say hello to the next generation of Search. Live Search – try it now. http://www.live.com/?mkt=en-ca

Attachment: main.cpp
Description: Binary data

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.