View Single Post
  #1   Spotlight this post!  
Unread 10-11-2012, 21:07
JPruim JPruim is offline
Registered User
FRC #4014
 
Join Date: Mar 2012
Location: United States
Posts: 5
JPruim is an unknown quantity at this point
What does the ampersand (&) mean in errors?

I get the error stack as follows when trying to compile the following code:

Code:
C:/Users/Josh/WindRiver/workspace/SimpleTemplate/limitSwitch.cpp: In constructor `limitSwitch::limitSwitch(UINT32)':
C:/Users/Josh/WindRiver/workspace/SimpleTemplate/limitSwitch.cpp:8: error: no matching function for call to `DigitalInput::DigitalInput()'
C:/WindRiver/vxworks-6.3/target/h/WPILib/DigitalInput.h:21: note: candidates are: DigitalInput::DigitalInput(const DigitalInput&)
C:/WindRiver/vxworks-6.3/target/h/WPILib/DigitalInput.h:24: note:                 DigitalInput::DigitalInput(UINT8, UINT32)
C:/WindRiver/vxworks-6.3/target/h/WPILib/DigitalInput.h:23: note:                 DigitalInput::DigitalInput(UINT32)
C:/Users/Josh/WindRiver/workspace/SimpleTemplate/limitSwitch.cpp:9: error: no match for call to `(DigitalInput) (UINT32&)'
C:\WindRiver\vxworks-6.3\host\x86-win32\bin\make.exe: *** [SimpleTemplate_partialImage/Debug/Objects/SimpleTemplate/limitSwitch.o] Error 1
Build Failed in Project 'SimpleTemplate' (Process Exit Value was 2):   2012-11-10 18:06:08   (Elapsed Time: 00:02)
when compiling

Code:
#include "WPILib.h"

class limitSwitch
{
	DigitalInput di; // robot drive system

public:
	limitSwitch(UINT32 p){
		di(p);
	}
};
Why is there an & symbol after UINT32? in the 'No match for call to...' error?
Reply With Quote