hocuz pocuz 0 Newbie Poster

> cout << winner << "'s won!\n";
If you were hoping to call this function, then you need cout << winner(someParameter) << "'s won!\n"; > what do you mean by "split main () up into more functions."
I mean, it's 300 or so lines long and it just waders from one aspect of the problem to the next.
My personal rule of thumb is that if you can't see the start { and end } of the whole screen at once, then it's time to think about splitting the function into something more manageable.

i still doesn't get it work.

when i play it, it said the row is already fill.

hocuz pocuz 0 Newbie Poster

can you also write in text or only binary?

hocuz pocuz 0 Newbie Poster

i kind of doesn't get that.. sorry

hocuz pocuz 0 Newbie Poster

can you find an example code for me?
Thx.

hocuz pocuz 0 Newbie Poster

In my book it said if you use function, it would make the program runs slower isn't it?

Thank You for your reply. Thank you for your suggestions.

hocuz pocuz 0 Newbie Poster

Hi. I am writing a text-rpg game using c++ and I want to save the gave somehow. How can i do it?

Thank you.

hocuz pocuz 0 Newbie Poster

I'm assuming that warning came with a line number?

> will always evaluate as `true'
It means that if you've done something like

if ( anExpressionWhichWarnsOfAlwaysBeingTrue ) {
} else {
  // do something important
}

Then it's telling you that something important isn't going to happen.

Oh, and split main () up into more functions.

Yes the warning came with a line number.
383 and 389

cout << winner << "'s won!\n";
[Warning] the address of `char winner(const std::vector<char, std::allocator<char> >&)', will always evaluate as `true'

what do you mean by "split main () up into more functions."

hocuz pocuz 0 Newbie Poster
//Four In a Row

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cctype>
#include <cstdlib>
#include <ctime>

using namespace std;

// global constants
const char X = 'X';
const char O = 'O';
const char EMPTY = ' ';
const char TIE = 'T';
const char NO_ONE = 'N';
const int WINNING_ROWS[69][4] = { 
                                     {0, 6, 12, 18},
                                     {1, 7, 13, 19},
                                     {2, 8, 14, 20},
                                     {3, 9, 15, 21},
                                     {4, 10, 16, 22},
                                     {5, 11, 17, 23},
                                     {6, 12 ,18, 24},
                                     {7, 13, 19, 25},
                                     {8, 14, 20, 26},
                                     {9, 15, 21, 27},
                                     {10, 16, 22, 28}, 
                                     {11, 17, 23, 29},
                                     {12, 18, 24, 30},
                                     {13, 19, 25, 31},
                                     {14, 20, 26, 32},
                                     {15, 21, 27, 33},
                                     {16, 22, 28, 34},
                                     {17, 23, 29, 35},
                                     {18, 24, 30, 36},
                                     {19, 25, 31, 37},
                                     {20, 26, 32, 38},
                                     {21, 27, 33, 39},
                                     {22, 28, 34, 40},
                                     {23, 29, 35, 41},
                                     {0, 1, 2, 3},
                                     {1, 2, 3, 4},
                                     {2, 3, 4, 5},
                                     {6, 7, 8, 9},
                                     {7, 8, 9, 10},
                                     {8, 9, 10, 11},
                                     {12, 13, 14, 15},
                                     {13, 14, 15, 16},
                                     {14, 15, 16, 17},
                                     {18, 19, 20, 21},
                                     {19, 20, 21, 22},
                                     {20, 21, 22, 23},
                                     {24, 25, 26, 27},
                                     {25, 26, 27, 28},
                                     {26, 27, 28, 29},
                                     {30, 31, 32, 33},
                                     {31, 32, 33, 34},
                                     {32, 33, 34, 35},
                                     {36, 37, 38, 39},
                                     {37, 38, 39, 40},
                                     {38, 39, 40, 41},
                                     {0, 7, 14, 21},
                                     {1, 8, 15, 22},
                                     {2, 9, 16, 23},
                                     {6, 13, …