Click here to Skip to main content
15,896,118 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAdding a newline character to a CString Pin
NILANKARAJA20-Nov-06 21:20
NILANKARAJA20-Nov-06 21:20 
AnswerRe: Adding a newline character to a CString Pin
toxcct20-Nov-06 21:26
toxcct20-Nov-06 21:26 
AnswerRe: Adding a newline character to a CString Pin
Michael Dunn20-Nov-06 21:38
sitebuilderMichael Dunn20-Nov-06 21:38 
QuestionSetting sock Internet Explorer proxy ? Pin
Radu Sorin20-Nov-06 20:40
Radu Sorin20-Nov-06 20:40 
QuestionThe Odd one out Pin
Waldermort20-Nov-06 20:22
Waldermort20-Nov-06 20:22 
AnswerRe: The Odd one out Pin
Cedric Moonen20-Nov-06 20:37
Cedric Moonen20-Nov-06 20:37 
GeneralRe: The Odd one out Pin
Waldermort20-Nov-06 20:47
Waldermort20-Nov-06 20:47 
GeneralRe: The Odd one out Pin
Cedric Moonen20-Nov-06 21:18
Cedric Moonen20-Nov-06 21:18 
You can simply make a loop then:

bool bAllEqual = true;
for (int i=0;i<TABLE_SIZE-1;i++)
{
  if (MyTable[i] != MyTable[i+1])
  {
     bAllEqual = false;
     break;
  }
}


As for efficiency, I think this method is more efficient than adding all the numbers and then dividing by the number of numbers (without counting the overflow for large numbers as you said)


Cédric Moonen
Software developer

Charting control [v1.1]

GeneralRe: The Odd one out Pin
Christian Graus20-Nov-06 22:11
protectorChristian Graus20-Nov-06 22:11 
GeneralRe: The Odd one out Pin
Waldermort20-Nov-06 22:56
Waldermort20-Nov-06 22:56 
Questionsending a mail Pin
neha.agarwal2720-Nov-06 19:53
neha.agarwal2720-Nov-06 19:53 
AnswerRe: sending a mail Pin
Programm3r20-Nov-06 19:58
Programm3r20-Nov-06 19:58 
AnswerRe: sending a mail Pin
Christian Graus20-Nov-06 20:00
protectorChristian Graus20-Nov-06 20:00 
Questioninserting a item in list ctrl Pin
neha.agarwal2720-Nov-06 19:46
neha.agarwal2720-Nov-06 19:46 
AnswerRe: inserting a item in list ctrl Pin
Waldermort20-Nov-06 20:28
Waldermort20-Nov-06 20:28 
GeneralRe: inserting a item in list ctrl Pin
neha.agarwal2720-Nov-06 21:03
neha.agarwal2720-Nov-06 21:03 
QuestionGUI Telnet Client Pin
harshandu20-Nov-06 19:37
harshandu20-Nov-06 19:37 
AnswerRe: GUI Telnet Client Pin
Waldermort20-Nov-06 20:35
Waldermort20-Nov-06 20:35 
Questionbackup to remote system Pin
Kiran Pinjala20-Nov-06 19:25
Kiran Pinjala20-Nov-06 19:25 
AnswerRe: backup to remote system Pin
Mila02520-Nov-06 20:12
Mila02520-Nov-06 20:12 
GeneralRe: backup to remote system Pin
Kiran Pinjala20-Nov-06 20:25
Kiran Pinjala20-Nov-06 20:25 
GeneralRe: backup to remote system Pin
Mila02520-Nov-06 20:31
Mila02520-Nov-06 20:31 
GeneralRe: backup to remote system Pin
Kiran Pinjala20-Nov-06 21:37
Kiran Pinjala20-Nov-06 21:37 
GeneralRe: backup to remote system Pin
Mila02520-Nov-06 21:44
Mila02520-Nov-06 21:44 
QuestionHow to Save bitmap data from clipboard to .bmp file. Pin
Kshitij Pande20-Nov-06 18:41
Kshitij Pande20-Nov-06 18:41 

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.