I want to split my code into multiple files. At this moment I have somethink like this but every time I need to include libraries and headers into each of these file.
Is it better way to do this?
main.cpp
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <conio.h>
#include <string.h>
#include <windows.h>
#include "modules/intro.cpp"
#include "modules/login.cpp"
using namespace std;
int main() {
introModule();
login();
system("pause");
}
intro.cpp
#include <iostream>
using namespace std;
void introModule() {
// content of intro file
}
login.cpp
#include <iostream>
#include <conio.h>
#include <string.h>
#include <windows.h>
#include "menu.cpp"
using namespace std;
#define ENTER 13
#define BACKSPACE 8
char passInputCharacter;
char password[20];
const char *accessPassword = "123";
int passInputCharacterPosition = 0;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
void login() {
// content of login file
}