Main file named main.ccp
Code:
#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>
using namespace std;
int main(int argc, char *argv[])
{
char choice;
printf("\n");
Sleep(100);
printf("\n");
Sleep(100);
printf("\n");
Sleep(100);
printf("\t\t\t By Me\n");
Sleep(100);
printf("\n");
Sleep(100);
putchar('\n');
Sleep(100);
printf("\t\t\t [N]ew Game\n");
printf("\t\t\t [Q]uit\n");
Sleep(100);
printf("\n");
Sleep(100);
printf("\n");
choice=toupper(getch());
for(;;)
{
if(choice=='N')
{
game();
break;
}
if(choice=='Q')
{
break;
}
}
return 0;
}
Begining of game file named game.ccp
Code:
//----------------------------------------Include Files-----------------------//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>
#include <windows.h>
#include <iostream>
using namespace std;
//----------------------------------------------------------------------------//
//-----------------------------------//--------------------------------------//
int game()
{
//----------------------------------------------------------------------------//
//----------------------------------Random Variables--------------------------//
int gold = 0; //Gold.
char choice; //Choices in game A,F,R,E.
int inumb; //Input number in gmae
int GetRand(int min, int max); //Random number gen.
int x; //Counter for size of sentence.
int size; //Size of sentence.
//Town 1 variable//
int beeninbar=0;
int beenintemple=0;
int population=263;
//Alments//
int disease=0;
int weak=0;
These 2 files are connected by the dev project file but for some reason it says that game is undeclared when i go to compile this file and im not sure why