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

C / C++ / MFC

 
GeneralRe: A Problem,thanks! Pin
wabc6-Feb-02 22:11
wabc6-Feb-02 22:11 
General2nd try..C++ Prototypes, Help! I am stuck.... Pin
bradb6-Feb-02 15:42
bradb6-Feb-02 15:42 
GeneralRe: 2nd try..C++ Prototypes, Help! I am stuck.... Pin
Christian Graus6-Feb-02 15:46
protectorChristian Graus6-Feb-02 15:46 
GeneralC++ Prototypes, Help! I am stuck.... Pin
bradb6-Feb-02 15:40
bradb6-Feb-02 15:40 
GeneralRe: C++ Prototypes, Help! I am stuck.... Pin
Christian Graus6-Feb-02 15:38
protectorChristian Graus6-Feb-02 15:38 
GeneralRe: C++ Prototypes, Help! I am stuck.... Pin
bradb6-Feb-02 15:43
bradb6-Feb-02 15:43 
Generalredirecting files Pin
6-Feb-02 15:31
suss6-Feb-02 15:31 
GeneralRe: redirecting files Pin
Christian Graus6-Feb-02 15:44
protectorChristian Graus6-Feb-02 15:44 
Yes, you can use IOStreams. Create a ifilestream, and it will read from the file using the same sort of code you've been using to read the keyboard.

ifstream file("c:\file.txt");

if (!file.isgood())
{
cout << "Failed to open file\n";
return;
}

char name[20];
int number = 0;

file >> name >> number;

This assumes you know the format you are reading in ( i.e. what is a string and how long it is, what is an int, etc. ), but I know in your case this is true. Check my previous posts for an easier way to read in a file into an array, but it's no good to you right now, because it uses STL, etc., which I know you're not allowed to do right now.


Christian

I have come to clean zee pooollll. - Michael Martin Dec 30, 2001

Picture the daffodil. And while you do that, I'll be over here going through your stuff.
GeneralRe: redirecting files Pin
6-Feb-02 16:02
suss6-Feb-02 16:02 
GeneralRe: redirecting files Pin
Christian Graus6-Feb-02 16:31
protectorChristian Graus6-Feb-02 16:31 
GeneralRe: redirecting file Pin
6-Feb-02 16:03
suss6-Feb-02 16:03 
GeneralRe: redirecting file Pin
Joaquín M López Muñoz6-Feb-02 22:10
Joaquín M López Muñoz6-Feb-02 22:10 
Generalarrays Pin
6-Feb-02 15:04
suss6-Feb-02 15:04 
GeneralRe: arrays Pin
Tim Smith6-Feb-02 15:15
Tim Smith6-Feb-02 15:15 
GeneralCircular reference in header file Pin
Mr.Freeze6-Feb-02 15:02
Mr.Freeze6-Feb-02 15:02 
GeneralRe: Circular reference in header file Pin
Tim Smith6-Feb-02 15:08
Tim Smith6-Feb-02 15:08 
GeneralRe: Circular reference in header file Pin
Mr.Freeze6-Feb-02 15:22
Mr.Freeze6-Feb-02 15:22 
GeneralRe: Circular reference in header file Pin
Tim Smith6-Feb-02 15:26
Tim Smith6-Feb-02 15:26 
GeneralRe: Circular reference in header file Pin
Mr.Freeze6-Feb-02 15:43
Mr.Freeze6-Feb-02 15:43 
GeneralRe: Any code analyzers? Pin
6-Feb-02 14:48
suss6-Feb-02 14:48 
GeneralRe: Any code analyzers? Pin
Tim Smith6-Feb-02 15:12
Tim Smith6-Feb-02 15:12 
GeneralA problem! Pin
wabc6-Feb-02 13:58
wabc6-Feb-02 13:58 
GeneralRe: A problem! Pin
Christian Graus6-Feb-02 14:24
protectorChristian Graus6-Feb-02 14:24 
QuestionCAsyncSocket will recv all packets in one recv? Pin
AnonymousBabe@usa.net6-Feb-02 13:49
AnonymousBabe@usa.net6-Feb-02 13:49 
AnswerRe: CAsyncSocket will recv all packets in one recv? Pin
Tim Smith6-Feb-02 15:27
Tim Smith6-Feb-02 15:27 

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.