Click here to Skip to main content
15,899,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: function pointers part 2 Pin
Mustafa Ismail Mustafa2-Oct-07 11:28
Mustafa Ismail Mustafa2-Oct-07 11:28 
GeneralRe: function pointers part 2 Pin
Stephen Hewitt2-Oct-07 17:27
Stephen Hewitt2-Oct-07 17:27 
AnswerRe: function pointers part 2 [modified] Pin
Stephen Hewitt2-Oct-07 13:25
Stephen Hewitt2-Oct-07 13:25 
AnswerRe: function pointers part 2 Pin
Cedric Moonen2-Oct-07 20:15
Cedric Moonen2-Oct-07 20:15 
GeneralRe: function pointers part 2 Pin
Stephen Hewitt2-Oct-07 21:40
Stephen Hewitt2-Oct-07 21:40 
QuestionSorting a value from file Pin
Herboren2-Oct-07 10:23
Herboren2-Oct-07 10:23 
AnswerRe: Sorting a value from file Pin
Stephen Hewitt2-Oct-07 13:46
Stephen Hewitt2-Oct-07 13:46 
AnswerRe: Sorting a value from file Pin
zakkas24832-Oct-07 19:14
zakkas24832-Oct-07 19:14 
hi
#include "stdafx.h"
#include <fstream>
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;

int v;
int loop;
int aA[8];
string ns;

int _tmain(int argc, _TCHAR* argv[])
{
ofstream ouI;
ouI.open("rwB.dat");
if( ouI.fail()){
cout << "Error reading file: " << endl;
exit(1);}
do {
cout << "File(SORT) Input an 8-Digit numeral: "; cin >> ns;
if ( ns.length() < 8 )
{
cout << "Human Error! " << "The value is too short!" << endl;
cout << "The value: " << ns << " is " << ns.length() << " digits long." << endl;
cout << "Press any key to re-enter a valid numeral." << endl;
_getch();
system("CLS");}

else if ( ns.length() == 8)
{
aA[0] = ns[0] - '0';
aA[1] = ns[1] - '0';
aA[2] = ns[2] - '0';
aA[3] = ns[3] - '0';
aA[4] = ns[4] - '0';
aA[5] = ns[5] - '0';
aA[6] = ns[6] - '0';
aA[7] = ns[7] - '0';

for ( v=0; v<ns.length(); v++="" )
="" oui="" <<="" aa[v]="" endl;=""
="" }
="" }="" while="" (="" ns.length()="" <="" 8="" );="" system("cls");
="" oui.close();="" cout="" endl="" "values="" have="" been="" written="" to="" file(sort)"="" endl;
="" "press="" any="" key="" sort="" the="" values."="" ifstream="" ini;
="" ini.open("rwb.dat");
="" if(="" ini.fail()){
="" "error="" writing="" file:="" "="" exit(1);}
="" char="" buff;
="" int="" aarray[8];
="" for(="" iloop="0" ;="" iloop<8;iloop++)
="" {
="" ini.getline(&buff,2,'\n');
="" aarray[iloop]="buff-'0';
" ini.close();
="" <b=""> print unsorted data but from the file
for( int iLoop=0 ; iLoop<8;iLoop++)
{
cout<
AnswerRe: Sorting a value from file [modified] Pin
David Crow3-Oct-07 3:07
David Crow3-Oct-07 3:07 
GeneralRe: Sorting a value from file Pin
Herboren3-Oct-07 6:21
Herboren3-Oct-07 6:21 
Questionwhat is the difference between macro, pragma, and inline? Pin
Gofur Halmurat2-Oct-07 10:18
Gofur Halmurat2-Oct-07 10:18 
AnswerRe: what is the difference between macro, pragma, and inline? Pin
Mark Salsbery2-Oct-07 10:38
Mark Salsbery2-Oct-07 10:38 
Questionva_copy? Pin
DQNOK2-Oct-07 7:32
professionalDQNOK2-Oct-07 7:32 
AnswerRe: va_copy? Pin
Mark Salsbery2-Oct-07 8:19
Mark Salsbery2-Oct-07 8:19 
AnswerRe: va_copy? Pin
David Crow2-Oct-07 8:20
David Crow2-Oct-07 8:20 
GeneralRe: va_copy? Pin
DQNOK2-Oct-07 8:57
professionalDQNOK2-Oct-07 8:57 
QuestionHaving a the processID how to get the application instance (HINSTANCE) ? Pin
carabutnicolae12342-Oct-07 7:22
carabutnicolae12342-Oct-07 7:22 
AnswerRe: Having a the processID how to get the application instance (HINSTANCE) ? Pin
Maxwell Chen3-Oct-07 0:11
Maxwell Chen3-Oct-07 0:11 
QuestionCustom ComboBox Control - Need Advice [modified] Pin
Leslie Sanford2-Oct-07 6:45
Leslie Sanford2-Oct-07 6:45 
QuestionRe: Custom ComboBox Control - Need Advice Pin
Mark Salsbery2-Oct-07 8:21
Mark Salsbery2-Oct-07 8:21 
AnswerRe: Custom ComboBox Control - Need Advice [modified] Pin
Leslie Sanford2-Oct-07 8:25
Leslie Sanford2-Oct-07 8:25 
QuestionUsing Abstract classes Pin
Apstolo2-Oct-07 3:40
Apstolo2-Oct-07 3:40 
AnswerRe: Using Abstract classes Pin
Cedric Moonen2-Oct-07 4:00
Cedric Moonen2-Oct-07 4:00 
GeneralRe: Using Abstract classes Pin
Apstolo2-Oct-07 4:31
Apstolo2-Oct-07 4:31 
GeneralRe: Using Abstract classes [modified] Pin
Cedric Moonen2-Oct-07 4:37
Cedric Moonen2-Oct-07 4:37 

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.