这可能是一个包含问题,我在整个代码中都遇到了这些错误,而不仅仅是字符串标识符,error C2146: syntax error : missing ';' before identifier 'getName'
例如error C2146: syntax error : missing ';' before identifier 'name'
这是一个示例类:
#include "stdafx.h"
class participant
{
public:
participant(int id, string name);
~participant(void);
int getId();
string getName();
private:
int id;
string name;
};
这是我的stdafx.h
文件:
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <list>
#include "day.h"
#include "appointment.h"
#include "extendedAppointment.h"
#include "participant.h"
#include "calendar.h"
using namespace std;
#define no_such_appointment_error 20;
#define conflicting_appointments_error 21;
#define noSuchDayError 22;
#define incorrectAppointmentError 23;