Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 Actually I realized just now with this logic, that the root will just constantly be replaced instead of children being put into the tree. But if I don't set the root there then I'll get seg faulted... |
Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 Yeah I did that, it was just the syntax I needed. I know how the logic works. Thank you. |
Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 Wow that fixed it, gonna make sure the rest of my logic is tight. So basically by ignoring the temp == null case, I was trying to access memory that wasn't there when I assinged values to temp after... |
Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 Updated code. Is this what you were talking about Doesn't work yet though.
#include<vector>
#include<string>
#include<cstring>
#include<iostream>
#include<fstream>
#include <stdlib.h> |
Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 Ok, I thought you had to have a constructor to use new. |
Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 Well I do have one, or am I missing something? |
Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 Thanks for the replies, still looking for the answer. |
Forum: C++ 7 Days Ago |
| Replies: 17 Views: 238 I have a seg fault I can't seem to be rid of. Basically I'm building an AVL tree and I'm stuck on the insert method. gdb says it is occuring on the line with:
while( temp != NULL &&... |
Forum: C++ Oct 14th, 2009 |
| Replies: 2 Views: 403 I think I get it. Basically, just retool the logic thinking of how it would usually work in the original tree I think. Hopefully I can figure it out. |
Forum: C++ Oct 14th, 2009 |
| Replies: 2 Views: 403 I'm having a small problem. I've created a binary tree that represents an n-ary tree using the left-child and right sibling syntax. I know that preorder on the binary tree gives you the same result... |
Forum: C++ Sep 22nd, 2009 |
| Replies: 3 Views: 280 Thank you for the reply. I've fixed the problem by adding a tail pointer but I'm concerned about the memory leaks so thanks for that. I assume its why my implementation doesn't work on the redhat... |
Forum: C++ Sep 21st, 2009 |
| Replies: 3 Views: 280 This is a method I used for adding a object, flightnode, into a linked list. Basically it takes in the value in and puts it in order based on the int flightno in the flightnode object. It works... |
Forum: C++ Mar 1st, 2009 |
| Replies: 5 Views: 481 I've updated my code since then. I've also gotten a suggestion to determine the number of adjacent mines when planting them in the board.
#include <iostream>
#include <cstdlib>
#include... |
Forum: C++ Mar 1st, 2009 |
| Replies: 5 Views: 481 With the line put back in.
With the line commented out. ( I have it that all cells are visible for testing purposes).
Basically I need help coming up with a function that can properly read... |
Forum: C++ Mar 1st, 2009 |
| Replies: 5 Views: 481 Its supposed to count the number of mines around a cell and add one to numMines each time it encounters a mine. After it tallies up the surrounding mines (1-8) it changes the label of the cell to... |
Forum: C++ Mar 1st, 2009 |
| Replies: 5 Views: 481 I'm doing this minesweeper assignment and I need help. I tried to test the findMineValues() function and it completely scrambles up my board. Can someone help me pinpoint what I am doing wrong?
... |
Forum: C++ Oct 4th, 2008 |
| Replies: 3 Views: 884 Alright that worked. Though there was one problem. An y with . . over it was put at the end. Could you explain that?
EDIT: I also was wondering if I can merge all white space into one ' ' char... |
Forum: C++ Oct 4th, 2008 |
| Replies: 3 Views: 884 I'm trying to read in the chars for a file in order to compare two text files. The problem is I can't seem to load space characters into my vectors. Any suggestions for me?
vector<char>... |