The class im taking does not let us use functions we havent learned yet so i can't use that. We are only supposed to use the functions i have labeled in my store.h file, if that makes sense. Any...
Type: Posts; User: Kross7
The class im taking does not let us use functions we havent learned yet so i can't use that. We are only supposed to use the functions i have labeled in my store.h file, if that makes sense. Any...
Yea, the project I am doing calls for three functions. One to search through an array of objects, one to remove items from the array and one to modify items in the array. I'm wondering how to get...
Ok I tried the
enum { SIZE = 500}; but I still ned help on sortingt through my array using strings. Any ideas or help would be greatly appreciated.
Thanks
Ok I think I fixed all of those little things you mentioned except for the whole pointer thing that had to do with me declaring my SIZE constant. The one major thing I am having trouble with is my...
Hey guys, this is my first time using object oriented programming and I'm having a little bit of trouble. I'm trying to create a "Store" class that feeds off my "inventory" class which I have...
Yea thats what you told me to do and I asked why the function I tried didn't work and no one responded. So I thought my question would be answered faster in a new thread and it was.
Yea sorry I feel like a retard, I got it tho.
void initBoard ( char array[][COLS], int rows )
{
for (int a = 0; a < ROWS; a++)
{
for (int b = 0; b < COLS; b++)
K so I made my initBoard just like my display board because my display board displays a 3x3 array of *'s when I start. The problem I have is when it asks to play another game and I say yes the board...
I get some error messages when I try and pass it that way.
line: 13 declaration of `array' as array of references
In function `int main()':
line: 30 invalid conversion from `char...
I run this tic tac toe problem and it runs great through 1 iteration and then when the next iteration runs the same board appears. I thought my initBoard function was good, but I guess its lacking...
Ok I have changed to initBoard function to what I think should initialize the board but its not working at all. I have also changed my if statements to incorporate the *'s. If anyone could tell me...
Ok I finally got what daved was saying about returning a value from the winner function. Now my problem resides where I decide to play another game the board won't clear. Where should I put my...
This may sound kind of lame, but we aren't allowed to use pointers in our source code because we havent covered those yet. I'm open to othr ideas tho.
Thanks for the help.
Is ignoring the '*'s a possibilty why i cant break out of the loop. How should I incorporate ignoring the '*'s into my if statements?
The program does correctly display a winner when 3 x's or 3 o's are lined up. I'm calling the winner function is the playOneGame function and it returns the answer correctly I just can't break out...
OK I'm not sure how to avoid the '*'s in my function but the program works fine for the class I'm in and doesnt declare '*' as a winner even when the board looks like the one above. I have changed...
I have written the program and it runs allright, there is just one problem. I can't get the loop to break after a winner is declared and I'm not sure if my winner function is working properly.
Any...
Ok so now I can get the computer to spit out the winner, but its late and doesnt recognize when the 'x' player wins for some reason.
Here it is:
#include <iostream>
#include <iomanip>...
Ok I think I fixed all the little things, but I still cannot figure out how to display a winner when a winner is determined. My program spits out a winner everytime it is ran.
Here is my code:
...
I can play the game just fine but I can't get the code to declare the winner after a winner is determined.
here is my code:
#include <iostream>
#include <iomanip>
using namespace std;
I changed up my code a little bit and can now play a full game but I need the loop to end when there is a winner and then ask if another game is to be played and if so to start the loop over again. ...
Thanks for the input, I fixed that but the same error message occurred. So ifnyone else has suggestions I'll be here all night.
The playing board looks like:
1 2 3
4 5 6
7 8 9
Please select a space on the board to place your 'x' by selecting space 1 through 9
2
invalid entry
1 120 3
4 5 6
7 8 9
Thanks for that!! I got the program to compile by matching the prototypes to work but when prompted to enter the position for player 1, no matter which number I enter I get "invalid entry."
I keep getting an error message on line 23 using bloodshed dev-C++ that states:
"invalid conversion from ' [3]' to 'int'"
I was wondering what the hell that meant.
here is my code: