No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
Unable to open file with fstream. it always seems to jump to the else statement and gives me the error message "Error: can't open input file ". I have included in the header file [CODE]#include <iostream> #include <fstream> #include <sstream>[/CODE] and in the class file i have the following code … | |
I have created an iterator for a vector and i need to create a return type for an object found in the vector. vector<Student>::iterator StudentRecord::find(const string& studentName){ vector<Student>::iterator find; for(find = students.begin(); find != students.end(); find++) { if(find->getName() == studentName){ return find; // Not sure if i am allowed to … | |
1. How do i convert an object (students) which is of type string into a string. 2. How do i remove all characters from a string after a space character. ie. i want to read an Object eg. "WILSON","MBCP" convert it to a string and then remove "MBCP". Then i … | |
I have a header file called StudentRecord.cpp which declares the function: vector<Student>::iterator find (const string& studentName); In my Student Record.cpp file i have written the folloing code: vector<Student>::iterator StudentRecord::find(const string& studentName){ vector<Student>::iterator find; for(find = students.begin(); find != students.end(); find++) { if (students[find].getName() == studentName) { return students[find]; } else … |