TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALBERTO MONTEIRO
from: CAMERON CLARK
date: 1997-12-14 21:45:00
subject: Re: What`s wrong with this?

AM>   Vector(double xx = 0, double yy = 0);    // constructor
    Are two default values legal?
AM> Vector Vector::operator+(const Vector & V2) const
AM> {
AM>   Vector add;
AM> 
AM>   add.x = x + V2.x;
AM>   add.y = y + V2.y;
AM>   return add;
AM> }
String operator+(String& left, String& right) {
  String str;
  strcat(str.s, left.s);
  strcat(str.s, right.s);
  str.getLength();
  return str;
}
    I used the same type of temporary in the same type situation
    with no problems.
    return str;
    Returns the value of the 'str' object before it is deallocated.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.