[b][red]This message was edited by imakaia at 2006-3-3 3:50:49[/red][/b][hr]
I'm going to post this instead of little topics asking for help.
I'm creating in C++ a a program whixh wil be a simulator of the game ROME TOTAL WAR. Just the campaign-economical par. There will be no armies and no AI or other provonces. And it will be just in code with no graphics.
THis is the programm.
This is the programm I created so far. There is a function where economical values are set(ERM). A function which aks you what do you want (passing is its name) to do, mean if you want to end the turn or uild something and shows you your income-expenses etc.
And there is a function that ends the turn. Previously there was a function for a builiding called comunnal farming but the problem was that when the programm was addinf the annual income from the building just once mean the year it was constructed. This is waht i'm trying to fix now by setting a value curntMoney in the ebd_turn function and not to the economical manager function where all the others are. This will be ecual with(CurntMoney=(Incm-Expns)+CurntMone) and it will be transported with a pointer to the ERM function where it will be equalized with another which wiill be took by the passing function to be showed to you each time. So at each end of turn the value is going to change
The fact is that despite the debugger says 0 errors 0 warnings when i press run it appears the microsoft probrm report saying that the application has problem.When i press show problem it points to the blue line. This happened after i created that pointer( red color)
[GREEN]//ECONOMICAL REMINDER MANAGERS[/GREEN]
long int ERM[RED](long int &pCD)[/RED]
long int FIncm=100, TrdIncm=0, TaxIncm=0, CnExpn=0, ARExpn=0, AUExpn=0, [RED]CurntMoney;[/RED]
long int Incm, Expns, denarli, turn=100;
Incm=FIncm + TaxIncm + TrdIncm;
Expns= CnExpn + ARExpn + AUExpn;
[GREEN]//END OF ECONOMICAL REMINDER MANAGERS[/GREEN]
long int passing(long int &FIncm,long int &TrdIncm,long int &TaxIncm,long int &CnExpn,long int &ARExpn,long int &AUExpn,long int &Incm,long int &Expns,long int &denarli, long int &turn, long int &CurntMoney)
short int choice;
cout <<" curent income: "<< Incm <<" expenses: "<< Expns;
cout <<" FarmingIncome: "<<FIncm<<"
cout <<"press 1 for end of turn, 2 to build farm";
cin >> choice;
// case 2: cout<<"farm requires 2 turns to be build. Once build, it will add +200 to your income!";
// building_farm ();
// end_turn (Incm,Expns,CurntDenarli,turn);
// BUILDINGS'S FUNCTIONS
// END OF BUILDINGS'S FUNCTIONS[/GREEN]
long int end_turn (long int &Incm,long int &Expns,long int ,long int &turn)
[RED] long int CurntMoney=20000;[/RED]
[RED] long int* pCD=&CurntMoney;[/RED]
[RED]long int main(long int &pCD)[/RED]
Hi, from the main
Hi form the main