23 reputation
4
bio website
location
age
visits member for 1 year, 11 months
seen Feb 26 '13 at 15:58

ActionScript/C# programmer by day. Struggling C++ programmer by night.


Sep
24
awarded  Autobiographer
Jan
24
awarded  Scholar
Jan
24
accepted Non-lvalues as function parameters in C++
Jan
24
comment Non-lvalues as function parameters in C++
Ah yes, I just realized this after reading your earlier comment. So this was probably all down to me misreading the example in the book. The compiler throws an error now and I even get a runtime exception (access violation reading a memory location) and everything makes total sense now. Thanks for the help!
Jan
24
comment Non-lvalues as function parameters in C++
@jimwise (The original typo was vector<double> vector emptyvec() which is not valid syntax) I don't have the book here at the moment, but when I tried changing it from vector<double> to vector<double>& the compiler threw an error: warning C4172: returning address of local variable or temporary So that seems to be more in line with what the author was saying.
Jan
24
awarded  Editor
Jan
24
comment Non-lvalues as function parameters in C++
@jimwise That was a typo when I entered it here. The original program was actually written correctly :)
Jan
24
revised Non-lvalues as function parameters in C++
deleted 7 characters in body
Jan
24
awarded  Student
Jan
24
asked Non-lvalues as function parameters in C++