Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Federal102

  1. Federal102

    pointer to an instance of a different class

    Under your current scenario, I cannot think of a solution other than a void pointer. In general though, the use of void pointers in C++ is indicative of a design flaw. What are you trying to achieve?
  2. Federal102

    pointer to an instance of a different class

    If pObj is always intended to be a ponter to an instance of classB, then the following will also work for you... class classB; //forward reference class classA { public: int classtype; int dummy; classB * pObj; }; class classB { public: int classtype; int dummy; }; classA...
  3. Federal102

    Help with Selecting Sort of Structures

    Since this is C++ code, you could try making use of the STL. Something like.. [code] struct StudentRec { bool operator < (StudentRec &rhs) { return name < rhs.name; } string name; float average; }; struct Roster { vector<StudentRec> student; }; int main() { //set up test data...
  4. Federal102

    Input Stream Confusion

    If I understand your post correctly, you have a Race class that looks something like class Race { public: void SetName(string &); void SetDescription(string &); void SetUID(long); private: string name; string description; long UID; }; and a data file that looks like.. string1...
  5. Federal102

    Build comma separated string

    If you have six text boxes, some of which could be empty, you could try something like this... Dim myArray(6) As String myArray(0) = Text1.Text myArray(2) = Text2.Text myArray(3) = Text3.Text myArray(4) = Text4.Text myArray(5) = Text5.Text myArray(6) = Text6.Text Dim segString As String For...
  6. Federal102

    Can't define template member function in .cpp file

    VC++ is well known for its poor handling of templates. You did the right thing by defining the function in the header.
  7. Federal102

    file i/o problem (not about vc++)

    Is this what you are trying to achieve? fstream fs; char name[] = &quot;save.txt&quot;; fs.open(name, ios::in) if(fs.fail()) { cout << &quot;this shows at runtime&quot; << endl; fs.clear(); fs.open(name, ios::out); }
  8. Federal102

    Converting from C to VB

    It has MAX_LINES + 2 elements. MAX_LINES must have been defined somewhere else in the code and is a an integer
  9. Federal102

    Converting from C to VB

    It is an array of long
  10. Federal102

    this is making NO sense.

    When you say it stops working, what do you mean? eg, program aborts memory error invalid results
  11. Federal102

    stl multimap

    My bad - didn't study the post too closely
  12. Federal102

    stl multimap

    std::multimaps and std::maps contain pairs, not individual elements. The following should work for you... multimap<int, string, less<int> > mmid; string temp = &quot;hello&quot;; mmid.insert(make_pair(30, temp));
  13. Federal102

    CFtpConnection GetFile Question

    GetFile requires a pointer to a C style string as its first argument. It looks like the name of your string variable is RFile. If this is the case, the following should work.. ftpConnection->GetFile(RFile.c_str() , &quot;C:\\dumped\\newfile.txt&quot;, FALSE);
  14. Federal102

    Displaying a counter

    Good to see that the set container worked for you. To read in the file name as a command line argument, replace ifstream infile(&quot;input.txt&quot;); with ifstream infile(argv[1]);
  15. Federal102

    Creating a Class Polynomial

    Can you please provide a little additional detail relating to the format of the input. For example woukld the following be acceptable input.. poly1: 3x^3 + 2x^2 + x poly2: 2x^4 + 3x^2 Or would the required input be.. poly1: 0x^4 + 3x^3 + 2x^2 + x poly2: 2x^4 + 0x^3 + 3x^2 + 0x I suppose what...

Part and Inventory Search

Back
Top