- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 1
- Downvoting Members
- 2
I have a person class: [CODE=C++]class person { protected: string fname, lname, gender bdate; public: person(); // getters and setters };[/CODE] and a student class: [CODE=C++]class student: public person { private: string major, grade; public: student(); // getters and setters }[/CODE] } I'm not sure how to make the implementation … |
|
Re:
How do I access the base class protected/public methods in a derived object ? For example A and B are as defined below... [code=cplusplus] class A { int a; protected: int set(int v){ a = v; }; public: A(){}; int foo(){ return 0;}; }; class B : A { int … |
|
I have an issue with my while loop (line 17) displaying the last donor in the list twice. I've looked around and I couldn't find any solutions that worked for me. Any ideas would be greatly appreciated. Here is my function: [CODE=C++]void delete_record( istream* file, string keyword ){ char response; … |
|
Here is my function that reads in a list of integers and doubles the size of the array if there are too many inputs. The current size of the array is 10. [CODE=C++] int* read_list ( int *list, size_t *list_size_ptr, size_t *array_size ){ size_t index = 0; int *new_list; while … |
|
list is supposed to be an array of pointers, so hopefully I declared that correctly. This function is supposed to read lines of text and each line of text should have a pointer pointing to it so that I can sort them. What I don't understand is when I read … |
|
Here is what I have: [CODE]} else if ( argc > 1 ){ for ( int arg = 1; arg < argc; ++arg ){ infile.open( argv[arg] ); if ( infile ){ list = read_file( &infile, &lines ); } } } [/CODE] argv[1] = text.txt gets opened, but argv[2] = text2.txt … |
|
I need to read numbers from a user and then copy them to an array. This shouldn't be that hard but I think I'm making it hard by trying to use [I]getline[/I] and then parsing the numbers. Heck I don't even know how to do that. Is there an easy … |