so it should look like this
while(inFile >> V.name && V.name != "#")
now that i think about it, it dont make sense the way i originally had it. man i hate dealing with files
and u...
Type: Posts; User: tunerfreak
so it should look like this
while(inFile >> V.name && V.name != "#")
now that i think about it, it dont make sense the way i originally had it. man i hate dealing with files
and u...
i changed the while loop to look like this
while(inFile >> V.name != "#")
{
cout << "hi3" << endl;
}
and i get an infinate on hi3
ok when i do that i get an infinite look right there, y?
i want to read stuff in a text file one line at a time by line because i have to store the first thing in each line in a list the first time though, close the file reopen it again to get back to the...
i added the const and the errors went away but we will see if anything else arises with me doing that.
i am creating a graph from a file and i am getting 2 errors saying that i dont have a copy constructor in struct Edge and struct Vertex but i clearly do. it came up when i was doing my io function at...
isn this allocating mem for it??? that part was given by teacher so i just assumed it was
Key(char* data) { this->data = new char[strlen(data)];
strcpy(this->data,data);}
k i fixed that but it didnt fix the problem though
ok so i narrowed it down to my loadFile function wher i read the file in
void BST::loadFile()
{
Key key;
cout << "Enter the the file location" << endl;
cin >> inFileName;...
k got rid of thoes errors but it still crashes
ur right i missed that thx. but no that didnt fix it im positive its mostly my insert function cause when i take it out and just read the file then print it it prints out all the names but then...
i am trying to make a Binary Search tree and my program is crashing when i try to insert names from a file into the tree and i cant figure out y. my load file function works if i just read in the...
ok just an update now
i got it to loop through the players but now i cant get it out of the first while loop after all the players have gone so that i can print who won the game
int g = 0;...
forget about my other question now.
ok simple question i would think but i cant get it to work right. i have this loop
while(1)
{
do
{
player = p.getPlayer(k);
DECKS is a constant of 8 also its random so i get a shuffled deck of cards
that helped a little but my card class creates the card so i cant really go card.suit orcard.num. i randomise the cards face and suit i think its more of an if statement what im having trouble with...
im trying to write a loop so that 8 of each card in a blackjack game is made and i cant get it to work right. it should print out 8 cards for each card made and delete the card if there are already...
well i figured it out but list<Card>* hand does need to be a pointer it does not like it otherwise.
but here is what i came up with to print list
void Player::printHand()
{
...
no i know what the error means but the printHnad is suppose to print the players hand, card dont control that all that print() in the card class does is print what kind of card it is
ok then i will get an error saying that my print hand function is not a member of Card
sorry i didnt copy down far enought.. i did loop through the players hand though
for(iter = hand.begin(); iter != hand.end(); ++iter)
{
iter->printHand();
}
but i also get errors in...
im trying to make a blackjack game using stacks and lists and i am having a problem with my lists, its not being created and i dont know y? the list is a list of cards for the players and the stack...
so it should be something like
if(!array[currentDepth][currentRow][currentCol].getMarked())
or something along that order.
EDIT:
yup thats it, i just threw that in there and it worked...
so after a little testing i found out that what i really did there was stop printing if a player has won although it dont work perfectly though so now i dont know how to stop it from printing if...
u mean array[d][r][c].getMarked ? im not marking with that its just checking of the cell im in is marked by a player. i mark with array[currentDepth][currentRow][currentCol].mark(player)