Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFinding memory leaks and time consuming methods Pin
Jerome Conus27-Oct-03 3:31
Jerome Conus27-Oct-03 3:31 
GeneralRe: Finding memory leaks and time consuming methods Pin
Kevin McFarlane27-Oct-03 5:26
Kevin McFarlane27-Oct-03 5:26 
GeneralRe: Finding memory leaks and time consuming methods Pin
Tim Deveaux27-Oct-03 8:07
Tim Deveaux27-Oct-03 8:07 
QuestionArray/List? Pin
DaFrawg27-Oct-03 2:21
DaFrawg27-Oct-03 2:21 
AnswerRe: Array/List? Pin
David Crow27-Oct-03 2:36
David Crow27-Oct-03 2:36 
GeneralRe: Array/List? Pin
Kevin McFarlane27-Oct-03 4:48
Kevin McFarlane27-Oct-03 4:48 
GeneralRe: Array/List? Pin
David Crow27-Oct-03 5:00
David Crow27-Oct-03 5:00 
AnswerRe: Array/List? Pin
Kevin McFarlane27-Oct-03 5:09
Kevin McFarlane27-Oct-03 5:09 
How much of a beginner are you? Are you a beginner of VC++/MFC only or are you also fairly new to C++?

Apart from David's answer below you could also try using the vector class with the max_element algorithm. If you type "max_element" in the Help index and click on the Sample program link there is an example showing how to use it.

It is also possible to use max_element on a raw array, if you find that easier to get your head round.

double histogram[] = { 1, 4, 4, 6, 1, 2, 2, 3, 1, 6, 6, 6, 5, 7, 5, 4, 4 };<br />
int count = sizeof(histogram) / sizeof(histogram[0]);<br />
double* begin = histogram;<br />
double* end = histogram + count;<br />
double* maximum = max_element(begin, end);<br />
afxDump << "Maximum = " << *maximum << "\n"; // or use TRACE<br />


You should also "include <algorithm>"

Kevin
GeneralYou also need this Pin
Kevin McFarlane27-Oct-03 5:15
Kevin McFarlane27-Oct-03 5:15 
GeneralRe: Array/List? Pin
DaFrawg31-Oct-03 0:38
DaFrawg31-Oct-03 0:38 
GeneralCEdit notification message Pin
YaronNir27-Oct-03 2:10
YaronNir27-Oct-03 2:10 
GeneralRe: CEdit notification message Pin
Steve S27-Oct-03 2:19
Steve S27-Oct-03 2:19 
QuestionMessages missing for slider controls (and also for spinbuttons etc.)? Pin
DaFrawg27-Oct-03 2:09
DaFrawg27-Oct-03 2:09 
AnswerRe: Messages missing for slider controls (and also for spinbuttons etc.)? Pin
Roger Allen27-Oct-03 3:33
Roger Allen27-Oct-03 3:33 
AnswerRe: Messages missing for slider controls (and also for spinbuttons etc.)? Pin
Iain Clarke, Warrior Programmer27-Oct-03 3:48
Iain Clarke, Warrior Programmer27-Oct-03 3:48 
AnswerRe: Messages missing for slider controls (and also for spinbuttons etc.)? Pin
Chris Hills27-Oct-03 4:01
Chris Hills27-Oct-03 4:01 
GeneralRe: Messages missing for slider controls (and also for spinbuttons etc.)? Pin
DaFrawg27-Oct-03 22:37
DaFrawg27-Oct-03 22:37 
GeneralRe: Messages missing for slider controls (and also for spinbuttons etc.)? Pin
Chris Hills29-Oct-03 1:19
Chris Hills29-Oct-03 1:19 
GeneralRe: Messages missing for slider controls (and also for spinbuttons etc.)? Pin
Atlantys30-Oct-03 13:17
Atlantys30-Oct-03 13:17 
Generalmysql with release mode? urgent Pin
murali_utr27-Oct-03 1:33
murali_utr27-Oct-03 1:33 
GeneralRe: mysql with release mode? urgent Pin
Steve S27-Oct-03 1:41
Steve S27-Oct-03 1:41 
GeneralThanks For Ur Help. Pin
murali_utr27-Oct-03 1:45
murali_utr27-Oct-03 1:45 
Generalregd radio buttons in VC++ Pin
karteek27-Oct-03 1:12
karteek27-Oct-03 1:12 
GeneralRe: regd radio buttons in VC++ Pin
Steve S27-Oct-03 1:39
Steve S27-Oct-03 1:39 
GeneralRe: regd radio buttons in VC++ Pin
Iain Clarke, Warrior Programmer27-Oct-03 1:40
Iain Clarke, Warrior Programmer27-Oct-03 1:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.