I am exploring with using the implementation and separating my code into different header and source files. I have a class Security that is defined in security.h and then shows the definition in security.cpp. I am trying to have two other classes administrator and user that will each have their own login function which will utilize a function in from the security class. I began coding the administrator class and found that I could not use the function from the security class even though I had used #include"security.h".Anyway, it's probably a simple problem but I cant seem to figure it out, below is the security class header file and implementation file and administrator implementation file.
security.h
1 2 3 4 5 6 7 8 9 10 11 12
#pragma once
#include<iostream>
#include<cstdlib>
#include<string>
usingnamespace std;
class Security
{
public:
staticint validate(string username, string password);
};
static functions in a class require the class name to be used in invocation (unless invoked within a method of that class.) Non-static functions require an instance to operate on.