well, based on what you provided:
>the declarations are as follows:
>
>ifstream ifile;
>ofstream ofile;
>string names[10], names2[10], final_name = "";
>int highscores[10], highscores2[10], numhighscores = 0;
>
I'd assume that names isn't being filled.
Also, if your starting your loop with for (i=0...) why do you check to see if 
i==0? just print an endl before the loop and start it at 1.
Thanks,
_|_|_|_|_|  _|        _|_|_|_|            
    _|      _|_|_|    _|          _|_|_|  
    _|      _|    _|  _|_|_|    _|        
    _|      _|    _|  _|        _|        
    _|      _|    _|  _|_|_|_|    _|_|_|  
Visit TDS for quality software and website production
http://tysdomain.com
msn: [EMAIL PROTECTED]
aim: st8amnd2005
skype: st8amnd127
  ----- Original Message ----- 
  From: Paul David 
  To: [email protected] 
  Sent: Sunday, October 05, 2008 10:52 AM
  Subject: Re: [c-prog] file output


  the declarations are as follows:

  ifstream ifile;
  ofstream ofile;
  string names[10], names2[10], final_name = "";
  int highscores[10], highscores2[10], numhighscores = 0;

  On Oct 5, 2008, at 9:47 AM, Tyler Littlefield wrote:

  > when you compile with all warnings on, what do you get? Your pasting 
  > a loop. I don't see your names declarations or anything.
  >
  > Thanks,
  > _|_|_|_|_| _| _|_|_|_|
  > _| _|_|_| _| _|_|_|
  > _| _| _| _|_|_| _|
  > _| _| _| _| _|
  > _| _| _| _|_|_|_| _|_|_|
  > Visit TDS for quality software and website production
  > http://tysdomain.com
  > msn: [EMAIL PROTECTED]
  > aim: st8amnd2005
  > skype: st8amnd127
  > ----- Original Message -----
  > From: Paul David
  > To: [email protected]
  > Sent: Sunday, October 05, 2008 10:44 AM
  > Subject: Re: [c-prog] file output
  >
  > i'm using C++
  > On Oct 4, 2008, at 8:14 PM, Paul David wrote:
  >
  > > ofile.open("High Scores.txt");
  > > for(int i = 0; i < numhighscores; i++)
  > > {
  > > if(i > 0)
  > > {
  > > ofile << endl;
  > > }
  > > ofile << highscores[i] << endl;
  > > ofile << names[i];
  > > }
  > > ofile.close();
  > >
  > > In this code numhighscores is an int, highscores is an array of 
  > ints,
  > > names is an array of strings, ofile is an ofstream from the fstream
  > > header file
  > >
  > > Why are the highscores printed but not the names?
  > >
  > > please help and thanks in advance for any help
  > >
  > > -- Paul David
  > > [EMAIL PROTECTED]
  > >
  > > [Non-text portions of this message have been removed]
  > >
  > >
  > >
  >
  > [Non-text portions of this message have been removed]
  >
  > __________ NOD32 3495 (20081004) Information __________
  >
  > This message was checked by NOD32 antivirus system.
  > http://www.eset.com
  >
  > [Non-text portions of this message have been removed]
  >
  >
  > 

  [Non-text portions of this message have been removed]



   

  __________ NOD32 3495 (20081004) Information __________

  This message was checked by NOD32 antivirus system.
  http://www.eset.com


[Non-text portions of this message have been removed]

Reply via email to