🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Tito Flagella Fri, 16 Oct 1992 14:39
[] operator overloading
#428
Author: Tito Flagella
Date: Fri, 16 Oct 1992 14:39
24 lines
869 bytes
Anybody knows why gcc 2.2.2 compiling:

class PowerProduct {
 private:
  char *pp;
 public:
  PowerProduct() { pp = calloc(PPLength,1); };
  inline int& operator[] (int);
};

inline int& PowerProduct::operator[] (int i)
{
  return pp[i];
}


is giving the error:

tito@olimpo 22> gcc try.C
try.C: In method `int & PowerProduct::operator [] (int)':
try.C:21: cannot convert to a reference type

Tito Flagella.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads