No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to read from a text file multiple times but I only seem to be able to read the data once. Any advice would be greatly appreciated. [code] string input; while (!ifile.eof()) { getline(ifile,input); cout << input << endl; } while (!ifile.eof()) { ifile.get(ch); cout << ch; } [/code] |
|
Hi I'm trying to have an assignment operator for my linked list class so that when I call it, it replaces the current one with the one I pass in. i.e testList1 = testList2; I'm trying to get it so that testList1 will point to testList2. Here is the code … |
|
I'm having a problem inserting data into my binary search tree, it will insert some of it but not all. this is the header file for my BST class: [code=c++] #ifndef BST_H #define BST_H //----------------------------------------------------------------------------------------- #include <string> #include "LinkedList.h" //----------------------------------------------------------------------------------------- using namespace std; //----------------------------------------------------------------------------------------- class BST { public: //Default constructor, … |
|
Hi guys, When I try to compile the code below I get an error saying: error C2065: 'file' : undeclared identifier. But if I run the program it still works. [code=c++] // WordStreamTest.cpp //-------------------------------------------------------------------- #include "WordStream.h" //-------------------------------------------------------------------- using namespace std; //-------------------------------------------------------------------- void OutputNumber (const string &str); void OutputLine (int length); … |