main.cpp
#include "personel.h"
#include "functions.h"
#include <iostream>
#include <string>
#include <vector>
int main()
{
while (true)
{
std::cout << "welcome.\n 1 to register, 2 to login\n";
//register or login
int rORl = 0;
std::cin >> rORl;
if (rORl == 1)
{
register();
}
else if (rORl == 2)
{
std::cout << "logged in";
}
};
}
functions.h
#pragma once
#include <iostream>
void register();
functions.cpp
#include "functions.h"
void register()
{
std::cout << "hi\n";
};
personel.h
#pragma once
#include <iostream>
#include <string>
#include <vector>
struct Post
{
std::string content;
std::string timestamp;
};
struct FollowerNode
{
int userID;
FollowerNode* next;
};
class personel
{
std::string password;
std::string username;
std::string name;
std::vector<int> followers;
std::vector<Post> posts;
};
Im getting "a global-scope declaration may not have this storage class" on the register function. obviously the code isnt finished yet. But I'm expecting it to output hi when 1 is pressed but it doesnt even compile
many google searches. all ive found is "i left it alone for a few hours and it went away by itself"