Oh, that was what I was led to believe from above:
Type: Posts; User: whiskedaway
Oh, that was what I was led to believe from above:
Nothing I try will compile. First I was getting that hour and min were undeclared, and then when I declared them I was getting an ambiguous overload.
I'm not sure this part is as important as the...
Would it be a "."? Or maybe a " "? Or maybe it's another variable to store the ":"? I'm not really sure.
If you're reversing stringstream, would you just be reversing the arrows? So maybe:
stringstream out;
string time = in.str();
out >> hour >> ":" >> min;
int hour;
int min;
I'm not sure I...
Okay, so I have the wrong code then? I assumed that getline(inFile, cLine) would take line number cLine in file inFile and read that line. From what you've said, I guess that's not correct? How would...
Alright, so I've ended up doing this and it compiles:
for (int i=2; i < lineNo; i++) {
string cLine;
stringstream out;
out << i;
cLine = out.str();
...
This assignment is driving me insane!
I have a text file that looks like this:
3
CODE TIME DESCRIPTION
CODE TIME DESCRIPTION
CODE TIME DESCRIPTION
4
CODE1 CODE2 TIME1 TIME2
Hi. I'm trying to create a program that will give the duration between two different times. The times are read in from a text file and are in the form "9:00", "11:00", "15:30", "17:00", etc. I am...
Thank you! I knew it was a silly question. :D
Apologies in advance if this is a really dumb question, but I'm pretty new at C++. Anyway, I have a Student object that has the following toString:
string Student::toString() const {
return...
Thanks so much, that explained everything. :)
I am just starting out a course in C++ programming at university, and I've been given this line of code in a header file named Card.h:
bool operator < (const Card& rhs) const;
I'm meant to be...