Thread: C++ Video Game Player Program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Here is one problem:
    Code:
    void DisplayPlayerData(const string playerNameAr[], const int scoreAr[], int numPlayers)
    ...
        for (int i = 0; i < numPlayers; i++)
        {
            cout << setw(10) << left << playerNameAr[numPlayers]
            << setw(5) << right << scoreAr[numPlayers] << endl;
        }
    ...
    Presumably you meant numPlayers to be i.

    Applying my fix with previously mentioned fixes makes the output correct for me. If it does not for you, then provide up-to-date code and steps to get incorrect output.
    Last edited by Elysia; 09-30-2011 at 01:19 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Video player API etc.
    By g4j31a5 in forum C++ Programming
    Replies: 7
    Last Post: 09-19-2008, 11:53 AM
  2. Replies: 9
    Last Post: 11-11-2007, 02:31 PM
  3. Is it a watch? Is it an MP3 player? Is it a video player?
    By twomers in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 08-15-2006, 10:54 PM
  4. linux video player
    By colmd in forum Linux Programming
    Replies: 2
    Last Post: 06-28-2004, 04:27 PM
  5. Do most video game programmers program with C?
    By Tride in forum Game Programming
    Replies: 4
    Last Post: 05-12-2003, 05:59 PM