Help me with this weird error please
Code:
#include "Security.h"
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
Security::Security()
{
//ctor
}
Security::~Security()
{
//dtor
}
void Security::ErrorMsg()
{
sf::RenderWindow ErrorBox(sf::VideoMode(200,100,32),"Error");
sf::Text ErrorText;
sf::Font ErrorFont;
if(ErrorFont.loadFromFile("monospa1.ttf"))
ErrorText.setFont(ErrorFont);
ErrorText.setString("Access denied");
ErrorText.setScale(sf::Vector2f(0.6,0.6));
ErrorText.setPosition(200/6,130/3);
while(ErrorBox.isOpen())
{
sf::Event Error;
{
while(ErrorBox.pollEvent(Error))
{
if(Error.type == sf::Event::Closed || sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
ErrorBox.close();
}
}
ErrorBox.draw(ErrorText);
ErrorBox.display();
}
}
bool Security::passwords(int passType)
{
std::string pass;
if(passType == 1)
{
std::cout << "Type in your password (MPP ONLY): " << std::endl;
std::getline(std::cin, pass);
if( pass == "HelloWorld")
return true;
else
ErrorMsg();
}
else if (passType == 2)
{
std::cout << "[Click this window and type in your password]";
std::cout << "\n\n\n Type in your password (Teachers and Students): " << std::endl << std::endl;
std::cout << " password: ";
std::cout << " " ;
std::getline(std::cin,pass);
if (checkPassword(pass))
return true;
else
ErrorMsg();
}
return false;
}
bool Security::checkPassword(std::string password)
{
passwordArray[0] = "12345";
for(int i =0;i<1500;i++)
{
if(password == passwordArray[i])
return true;
}
}
line 45 : error: expected unqualified-id before 'namespace'
line 89 : error: expected '}' at end of input|
line 89 : error: expected unqualified-id at end of input|