No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Re:
**This forum is meant for discussing programming languages in addition to exchanging code and algorithms.** However, it has become a problem where too many students are posting homework problems expecting a quick solution without ever trying for themselves. Though we are all here to help, please don't expect quick solutions … |
|
MMmmmmk so what i am trying to do is simply throw a the ERROR object from the Array<T>::operator[] and catch it in main take a took... it prints out the equivalent of an empty space in memory. [code] //error.h class ERROR { public: ERROR(char * Incomming) { m_message = new … |
|
The compiler gives me a error C2955: 'Node' : use of class template requires template argument list. Some one wanna look it over and gimme some tips? [code] //list.h #ifndef LIST_H #define LIST_H #include "node.h" #include <iostream> template <typename T> class List { private: Node * m_head_node; Node * m_current_node; … |
|
Re:
[code=c++] #include <fstream> #include <iostream> #include <string> using namespace std; string getFileName(); int numCharsInFile( ifstream &in, int &nLines ); int numWordsInFile( ifstream &in, int &nWords ); main () { int nLines, nChar, avgCPL, nWords; ifstream textFile; string fileName; fileName = getFileName(); textFile.open(fileName.c_str()); if(!textFile.is_open()) { cerr << "Cannot open file: " … |
|
what about overloading the subscript operator to… say sort an array of ints without templates... example: [code] class Whatever { private: int * m_value; public: int &operator[](std::size_t index); }; [/code] |