Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Extract data from database Pin
David Crow29-Apr-04 4:54
David Crow29-Apr-04 4:54 
GeneralRe: Extract data from database Pin
dreamerzz29-Apr-04 4:57
dreamerzz29-Apr-04 4:57 
GeneralRe: Extract data from database Pin
David Crow29-Apr-04 5:03
David Crow29-Apr-04 5:03 
GeneralRe: Extract data from database Pin
gUrM33T29-Apr-04 4:06
gUrM33T29-Apr-04 4:06 
GeneralRe: Extract data from database Pin
dreamerzz29-Apr-04 4:08
dreamerzz29-Apr-04 4:08 
GeneralRe: Extract data from database Pin
Kevin McFarlane29-Apr-04 4:32
Kevin McFarlane29-Apr-04 4:32 
GeneralRe: Extract data from database Pin
dreamerzz29-Apr-04 4:37
dreamerzz29-Apr-04 4:37 
GeneralRe: Extract data from database Pin
David Crow29-Apr-04 4:47
David Crow29-Apr-04 4:47 
dreamerzz wrote:
so using CArray is the only solution...

No, of course not. It's just one of many implementations. From what information you've provided, it sounds like you simply need to store the numbers in a text file. Then you could process them with something like:

CStdioFile file("", CFile::modeRead);
CString strLine;
int nSum = 0,
nLineCount = 0;
 
while (file.ReadString(strLine) != FALSE)
{
    nSum += atoi(strLine);
    nLineCount++;
}
 
TRACE("The sum is %d\nThe average is %f\n", nSum, (double) nSum / nLineCount);



"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)


GeneralRe: Extract data from database Pin
dreamerzz29-Apr-04 4:49
dreamerzz29-Apr-04 4:49 
GeneralRe: Extract data from database Pin
David Crow29-Apr-04 4:59
David Crow29-Apr-04 4:59 
GeneralRe: Extract data from database Pin
dreamerzz29-Apr-04 5:05
dreamerzz29-Apr-04 5:05 
GeneralRe: Extract data from database Pin
David Crow29-Apr-04 5:13
David Crow29-Apr-04 5:13 
GeneralRe: Extract data from database Pin
gUrM33T29-Apr-04 4:35
gUrM33T29-Apr-04 4:35 
GeneralRe: Extract data from database Pin
dreamerzz29-Apr-04 5:07
dreamerzz29-Apr-04 5:07 
GeneralRe: Extract data from database Pin
gUrM33T29-Apr-04 7:57
gUrM33T29-Apr-04 7:57 
GeneralRe: Extract data from database Pin
David Crow29-Apr-04 5:10
David Crow29-Apr-04 5:10 
GeneralPls Helpl Pin
ThatsAlok29-Apr-04 2:41
ThatsAlok29-Apr-04 2:41 
GeneralRe: Pls Helpl Pin
22491729-Apr-04 4:15
22491729-Apr-04 4:15 
GeneralRe: Pls Helpl Pin
ThatsAlok4-May-04 20:53
ThatsAlok4-May-04 20:53 
QuestionHow to emulate a console window? Pin
Maxime Labelle29-Apr-04 2:06
Maxime Labelle29-Apr-04 2:06 
AnswerRe: How to emulate a console window? Pin
David Crow29-Apr-04 2:15
David Crow29-Apr-04 2:15 
GeneralRe: How to emulate a console window? Pin
Maxime Labelle29-Apr-04 2:55
Maxime Labelle29-Apr-04 2:55 
GeneralRe: How to emulate a console window? Pin
David Crow29-Apr-04 3:39
David Crow29-Apr-04 3:39 
GeneralRe: How to emulate a console window? Pin
Maxime Labelle29-Apr-04 4:18
Maxime Labelle29-Apr-04 4:18 
AnswerRe: How to emulate a console window? Pin
Ravi Bhavnani29-Apr-04 2:31
professionalRavi Bhavnani29-Apr-04 2:31 

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.