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

C / C++ / MFC

 
GeneralShow dialog window in PreCreateWindow(..) failed :( Pin
bilas11-Feb-05 6:39
bilas11-Feb-05 6:39 
GeneralRe: Show dialog window in PreCreateWindow(..) failed :( Pin
Michael Dunn11-Feb-05 16:37
sitebuilderMichael Dunn11-Feb-05 16:37 
GeneralAccess Database Report Pin
Tom Wright11-Feb-05 6:05
Tom Wright11-Feb-05 6:05 
GeneralRe: Access Database Report Pin
Anonymous11-Feb-05 12:07
Anonymous11-Feb-05 12:07 
GeneralRead file, write to array, find min and max Pin
dr.eu11-Feb-05 5:46
dr.eu11-Feb-05 5:46 
GeneralRe: Read file, write to array, find min and max Pin
David Crow11-Feb-05 6:00
David Crow11-Feb-05 6:00 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 6:05
dr.eu11-Feb-05 6:05 
GeneralRe: Read file, write to array, find min and max Pin
rocky_pulley11-Feb-05 6:09
rocky_pulley11-Feb-05 6:09 
I'm having trouble trying to understand what your problem is. You want to read all numbers and get the largest and smallest? I'm not understanding what you say is going wrong. I would try something like this:

#include <set>
#include <iostream>

using namespace std;

set<int> nums;
ifstream in(filename);

while(in)
{
int n;
in >> n;
nums.insert(n);
}

set<int>::iterator it = nums.begin();

cout << "first = " << (*it) << endl;

int last;
while(it != nums.end())
{
last = (*it);
it++;
}

cout << "last = " << last << endl;


-- Rocky Dean Pulley
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 6:14
dr.eu11-Feb-05 6:14 
GeneralRe: Read file, write to array, find min and max Pin
David Crow11-Feb-05 6:23
David Crow11-Feb-05 6:23 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 6:35
dr.eu11-Feb-05 6:35 
GeneralRe: Read file, write to array, find min and max Pin
David Crow11-Feb-05 6:51
David Crow11-Feb-05 6:51 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 7:08
dr.eu11-Feb-05 7:08 
GeneralRe: Read file, write to array, find min and max Pin
Mattias G11-Feb-05 6:32
Mattias G11-Feb-05 6:32 
GeneralRe: Read file, write to array, find min and max Pin
rocky_pulley11-Feb-05 6:35
rocky_pulley11-Feb-05 6:35 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 6:38
dr.eu11-Feb-05 6:38 
GeneralRe: Read file, write to array, find min and max Pin
rocky_pulley11-Feb-05 6:41
rocky_pulley11-Feb-05 6:41 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 6:49
dr.eu11-Feb-05 6:49 
GeneralRe: Read file, write to array, find min and max Pin
rocky_pulley11-Feb-05 6:52
rocky_pulley11-Feb-05 6:52 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 7:16
dr.eu11-Feb-05 7:16 
GeneralRe: Read file, write to array, find min and max Pin
David Crow11-Feb-05 8:12
David Crow11-Feb-05 8:12 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 9:30
dr.eu11-Feb-05 9:30 
GeneralRe: Read file, write to array, find min and max Pin
rocky_pulley11-Feb-05 9:32
rocky_pulley11-Feb-05 9:32 
GeneralRe: Read file, write to array, find min and max Pin
dr.eu11-Feb-05 9:44
dr.eu11-Feb-05 9:44 
QuestionHow to switch from vertical to gorizontal split windows? Pin
bilas11-Feb-05 5:33
bilas11-Feb-05 5:33 

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.