Reputation: 7
So I made this simple program from tutorial, and I get an error that says
Intellisense expected a ';'
The error is on this line int main()
line 19
This is the code:
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <string>
using namespace std;
class WilboClass{
public:
void setName(string x) {
name = x;
}
string getName() {
return name;
}
private:
string name;
}
int main()
{
WilboClass wo;
wo.setName("Sir Wilbo Wallace");
cout << wo.getName();
Sleep(5000);
return 0;
}
Upvotes: 0
Views: 117
Reputation: 7625
You just forgot to add semicolon ;
after class definition.
class WilboClass{
public:
void setName(string x) {
name = x;
}
string getName() {
return name;
}
private:
string name;
}; // <-- add here
Upvotes: 3