Click here to Skip to main content
14,242,360 members

C / C++ / MFC

 
Questionerror: expected identifier before string constant Pin
Vaclav_13-Jan-19 6:28
memberVaclav_13-Jan-19 6:28 
AnswerRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 6:49
protectorRichard MacCutchan13-Jan-19 6:49 
GeneralRe: error: expected identifier before string constant Pin
Vaclav_13-Jan-19 7:21
memberVaclav_13-Jan-19 7:21 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan13-Jan-19 22:29
protectorRichard MacCutchan13-Jan-19 22:29 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang16-Jan-19 23:28
memberStefan_Lang16-Jan-19 23:28 
GeneralRe: error: expected identifier before string constant Pin
Richard MacCutchan16-Jan-19 23:56
protectorRichard MacCutchan16-Jan-19 23:56 
GeneralRe: error: expected identifier before string constant Pin
Stefan_Lang17-Jan-19 1:30
memberStefan_Lang17-Jan-19 1:30 
AnswerRe: error: expected identifier before string constant Pin
k505413-Jan-19 8:29
memberk505413-Jan-19 8:29 
Vaclav_ wrote:
The error "points " to #define which is redefined in this class - temporary for test purposes.
Are you doing something like this?
#include "spi.h" // #defines DEVICE_SPI, etc

 #define DEVICE_SPI_"dev/spidev0.0" // Temporary define 

class C_VNA {
    // ...
};
That would mean that you're re-defining DEVICE_SPI, but normally your compiler should warn about redifines. Maybe you need #undef where you set up your temp defines. e.g.
#ifdef DEVICE_SPI
#define ORIG_DEVICE_SPI DEVICE_SPI
#undef DEVICE_SPI
#endif
#define DEVICE_SPI "dev/spidev0.0"
// your code here that uses the temporary DEVICE_SPI

#ifdef ORIG_DEVICE_SPI
#undef DEVICE_SPI
#define DEVICE_SPI ORIG_DEVICE_SPI
#undef  ORIG_DEVICE_SPI
#endif

AnswerRe: error: expected identifier before string constant Pin
Graham Breach13-Jan-19 23:21
memberGraham Breach13-Jan-19 23:21 
GeneralRe: error: expected identifier before string constant Pin
Vaclav_14-Jan-19 3:33
memberVaclav_14-Jan-19 3:33 
GeneralRe: error: expected identifier before string constant Pin
Graham Breach14-Jan-19 4:33
memberGraham Breach14-Jan-19 4:33 
AnswerRe: error: expected identifier before string constant Pin
Stefan_Lang16-Jan-19 22:38
memberStefan_Lang16-Jan-19 22:38 
GeneralRe: error: expected identifier before string constant Pin
Vaclav_19-Jan-19 18:31
memberVaclav_19-Jan-19 18:31 
Question(C) Robust code Should an unsigned int array index be tested for "< 0" Pin
HS_C_Student11-Jan-19 3:27
memberHS_C_Student11-Jan-19 3:27 
AnswerRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
CPallini11-Jan-19 5:25
mveCPallini11-Jan-19 5:25 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
Bram van Kampen12-Jan-19 14:29
memberBram van Kampen12-Jan-19 14:29 
SuggestionRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
David Crow11-Jan-19 5:40
memberDavid Crow11-Jan-19 5:40 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
HS_C_Student11-Jan-19 7:17
memberHS_C_Student11-Jan-19 7:17 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
David Crow11-Jan-19 7:33
memberDavid Crow11-Jan-19 7:33 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
Joe Woodbury11-Jan-19 11:54
professionalJoe Woodbury11-Jan-19 11:54 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
HS_C_Student11-Jan-19 12:18
memberHS_C_Student11-Jan-19 12:18 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
leon de boer12-Jan-19 3:36
memberleon de boer12-Jan-19 3:36 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
HS_C_Student12-Jan-19 4:59
memberHS_C_Student12-Jan-19 4:59 
AnswerRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
Bram van Kampen12-Jan-19 14:01
memberBram van Kampen12-Jan-19 14:01 
GeneralRe: (C) Robust code Should an unsigned int array index be tested for "< 0" Pin
HS_C_Student12-Jan-19 16:50
memberHS_C_Student12-Jan-19 16:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.