Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
~3K People Reached
Favorite Forums
Favorite Tags
Member Avatar for ksm092

Hi, I have two classes in two separate .cpp files. I obtain a string using cin and then I need to use this string in a method in a separate class. If that makes sense.. [CODE]class HomePage{ static void HsubmitChangeDutyRequests(string) { Duties::submitChangeDutyRequests(string);} }[/CODE] [CODE]class Duties{ static void submitChangeDutyRequests(string); }[/CODE] This …

Member Avatar for vijayan121
0
322
Member Avatar for ksm092

Hi I am trying to assign 5 people various objectives between day0 and day13. However the output is not correct and goes fuzzy in the second half of the output. This is my code: [CODE]for(int x=1, y=0; y < 5, x < 15; x++, y++) { array[x][y] = objectives[y]; if …

Member Avatar for ksm092
0
109
Member Avatar for ksm092
Member Avatar for ksm092

This is my code: [CODE] stringstream str_number string description while(!str_number.eof()) { str_number >> str_description; if (str_description.length() < 1) { break; } description = description +" "+ str_description; }[/CODE] My problem is that if the description is more than one string, the last string is repeated twice. For example if the …

Member Avatar for nuclear
0
1K
Member Avatar for ksm092

This is my code: [CODE] for (i = 0; i < date.size(); i++) { str_date << date[i]; str_date >> newDay; str_date >> newMonth; str_date >> newYear; apptDay.push_back(newDay); apptMonth.push_back(intMonth); apptYear.push_back(newYear); }[/CODE] My problem is that the first date[1] gets saved nicely, however the second round of the loop it all goes …

Member Avatar for ksm092
0
106
Member Avatar for ksm092

I am trying to sort a vector of strings in order (one line consists of various strings e.g. 12 10 2010) and was wondering if I would be able to extract individual values from one line of a vector? The way I am doing this is by reading lines from …

Member Avatar for jinhao
0
180
Member Avatar for ksm092

This doesnt work as it should... [CODE]void renameMonths(string month) { if (month == "jan") { month = "january"; } } int main() { string month; month = "jan"; renameMonths(month); cout << month << endl; }[/CODE] the output is just jan, when it should be january. Thanks in advance.

Member Avatar for Narue
0
227
Member Avatar for ksm092

This is my code: [CODE] void removeAppointments() { vector <string> newfile; string line; int i; int n; ifstream Appointments; ofstream newAppointments; Appointments.open(DATAFILE); newAppointments.open(newDATAFILE); if (Appointments.is_open() && newAppointments.is_open()) { // Read the file until it's finished, displaying lines as we go. while (!Appointments.eof()) { getline(Appointments, line, '\n'); // getline reads a …

Member Avatar for ksm092
0
176
Member Avatar for ksm092

I am making a program (new to c++) which lets you save contacts and then allow you to list them and remove them. I am lost to how I would number each contact, for example: 1. Sam 21340223 2. Jessica 21020303

Member Avatar for jinhao
0
124
Member Avatar for ksm092

When I want to access a part of the vector (appointment) it won't allow it, for example simply adding: [CODE]cout << appointment[1];[/CODE] will not work. I also want this vector to be saved to my class (Appointment), so I can later remove elements of the vector. Would I be able …

Member Avatar for VernonDozier
0
245
Member Avatar for ksm092

I am trying to add a numbering system to a list in a datafile: [CODE] Appointments.open(DATAFILE); if (Appointments.is_open()) { // Read the file until it's finished, displaying lines as we go. while (!Appointments.eof()) { getline(Appointments, line, '\n'); // getline reads a line at a time appointment.push_back(line); cout << i << …

Member Avatar for ksm092
0
89
Member Avatar for ksm092

Hi, I'm studying Mechatronics engineering in my 2nd year and I'm doing a software design paper... so here I am :D You guys have been so much help so far its the best community I've ever seen!

0
39