15,999,026 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 Re: ChartFX Compatiability Gary Qiu25-Oct-12 5:46 Gary Qiu 25-Oct-12 5:46
 the program exit after creating process in the solaris jonesliu24-Oct-12 0:51 jonesliu 24-Oct-12 0:51
 Re: the program exit after creating process in the solaris Richard MacCutchan24-Oct-12 1:06 Richard MacCutchan 24-Oct-12 1:06
 Finding Min and Max of array Mikerush723-Oct-12 6:50 Mikerush7 23-Oct-12 6:50
 Re: Finding Min and Max of array jeron123-Oct-12 7:36 jeron1 23-Oct-12 7:36
 Re: Finding Min and Max of array Chris Losinger23-Oct-12 8:31 Chris Losinger 23-Oct-12 8:31
 Re: Finding Min and Max of array CPallini23-Oct-12 10:47 CPallini 23-Oct-12 10:47
 Re: Finding Min and Max of array «_Superman_»23-Oct-12 19:34 «_Superman_» 23-Oct-12 19:34
 Since this is your assignment, you probably want to write the algorithm yourself. But just so you know, C++ already has an implementation for this algorithm. So a C++ program would be as follows - XML ```#include int main() { double arr[7] = { 5.6, 3.4, 9.8, 1.2, 5.5, 9.9, 4.9 }; std::pair minmax = std::minmax_element(&arr[0], &arr[7]); double min = *minmax.first; double max = *minmax.second; return 0; }``` With the new C++ standard, you could write this in a more generic way - XML ```#include int main() { double arr[7] = { 5.6, 3.4, 9.8, 1.2, 5.5, 9.9, 4.9 }; auto minmax = std::minmax_element(std::begin(arr), std::end(arr)); auto min = *minmax.first; auto max = *minmax.second; return 0; }``` «_Superman_»  I love work. It gives me something to do between weekends. Microsoft MVP (Visual C++) (October 2009 - September 2013)Polymorphism in C
 Re: Finding Min and Max of array Sajeesh Payolam23-Oct-12 20:10 Sajeesh Payolam 23-Oct-12 20:10
 Re: Finding Min and Max of array Mikerush724-Oct-12 3:28 Mikerush7 24-Oct-12 3:28
 How to delete Registry Key with Maximum rights platso_58823-Oct-12 2:40 platso_588 23-Oct-12 2:40
 Re: How to delete Registry Key with Maximum rights Jochen Arndt23-Oct-12 3:02 Jochen Arndt 23-Oct-12 3:02
 Re: How to delete Registry Key with Maximum rights platso_58824-Oct-12 5:17 platso_588 24-Oct-12 5:17
 Re: How to delete Registry Key with Maximum rights Jochen Arndt24-Oct-12 5:45 Jochen Arndt 24-Oct-12 5:45
 Re: How to delete Registry Key with Maximum rights platso_58824-Oct-12 20:27 platso_588 24-Oct-12 20:27
 Re: How to delete Registry Key with Maximum rights Jochen Arndt24-Oct-12 21:15 Jochen Arndt 24-Oct-12 21:15
 message CBN_SELENDOK not sent when using mouse NoviceEx23-Oct-12 2:07 NoviceEx 23-Oct-12 2:07
 Re: message CBN_SELENDOK not sent when using mouse Jochen Arndt23-Oct-12 2:51 Jochen Arndt 23-Oct-12 2:51
 Re: message CBN_SELENDOK not sent when using mouse NoviceEx23-Oct-12 3:05 NoviceEx 23-Oct-12 3:05
 Re: message CBN_SELENDOK not sent when using mouse Jochen Arndt23-Oct-12 3:23 Jochen Arndt 23-Oct-12 3:23
 Re: message CBN_SELENDOK not sent when using mouse NoviceEx23-Oct-12 21:48 NoviceEx 23-Oct-12 21:48