invalid initialization of non-const reference of type 'CTime&' from an rvalue of

Alright....how do I declare these functions?

CTime CProgramStation::getStartTime()
{
  CTime time(0, m_nStartHour, m_nStartMinute, 0);
  return time;
}

CTime CTime::operator =(CTime timeOther)
{
  m_nDOY = timeOther.m_nDOY;
  m_nHours = timeOther.m_nHours;
  m_nMinutes = timeOther.m_nMinutes;
  m_nSeconds = timeOther.m_nSeconds;
  return *this;
}

So that I can use them like this:

m_time = m_arrayStations[nStation - 1].getStartTime(); 
/* CProgramStation m_arrayStations[MAX_STATIONS]*/

Without getting this compile error

invalid initialization of non-const reference of type 'CTime&' from an rvalue of

I am sure this sort of thing is a great deal easier in MS Visual C++.

You can do things like this without any hassle

return CString("CCCCCC");

I am sure this sort of thing is a great deal easier in MS Visual C++.

You'd be wrong. The resulting code in the IDE and Microslop's tool is standard C++ code.

Without getting this compile error

Why would lop off the most important parts of the error message?

I'm nearly certain that your code would be far simpler if you were taking/returning pointers to instances rather than objects.

Post ALL of your code.

How can yo possibly expect someone to propose a solution (much less compile it) without at least the full declaration and definition of the class? One would think that after 1200+ post you would have figured that out by now.

gfvalvo:
How can yo possibly expect someone to propose a solution (much less compile it) without at least the full declaration and definition of the class? One would think that after 1200+ post you would have figured that out by now.

This is a long way from a trivial project - tens of thousands of lines of code and 30 odd source files.

So I am not sure it is practical to post all my code so that you can compile it.

It is a generic programing problem here - nothing that is specific to my project.

One function returns an object (not a reference to an object) and another function takes an object (not a reference to an object) as a parameter.

I don't understand where the compiler thinks the lvalue is.

boylesg:
This is a long way from a trivial project - tens of thousands of lines of code and 30 odd source files.

Agreed, nobody wants to look through that much clutter. Post an MCVE.

I don't understand where the compiler thinks the lvalue is.

It's clearly on line n, as indicated in the compiler message that you truncated.