-1

Good Day,

I have a C++ Class that looks like this:

class WiFlyRNXV{
public:
WiFlyRNXV(byte pinReceive, byte pinSend);                   //Constructor with Pins for UART
SoftwareSerial uart;                                        //SoftwareSerial driver
IRSystem irSystem;
}

and the constructor looks like this initially..

WiFlyRNXV::WiFlyRNXV(byte pinReceive, byte pinSend) : uart (pinReceive, pinSend){}

I had no issues..but once I did this:

WiFlyRNXV::WiFlyRNXV(byte pinReceive, byte pinSend) : uart (pinReceive, pinSend),irSystem(8){}

It suddenly threw a whole load of errors, including missing brackets, parsing errors etc. in my Main.cpp file. I can't understand why this would happen. Main includes the above class btw.

4

1 回答 1

1

在类声明之后,您忘记放置分号。

尝试这个:

class WiFlyRNXV{
public:
WiFlyRNXV(byte pinReceive, byte pinSend);                   //Constructor with Pins for UART
SoftwareSerial uart;                                        //SoftwareSerial driver
IRSystem irSystem;
};
于 2013-06-30T10:05:00.493 回答