any idea to put an array and pointer?

these are my codes
please someone help me...
i don't know where to put pointer and i have to present my codes this week..
thanks..(^_^)

#include<iostream>
#include<string>
using namespace std;
void deposite();
void withdraw();
struct BANK
{
float in,balance,money1;
}bank;

int main()
{


float money,balance;
int password,choice;
char answer;
string name="";


cout<<"Assumed your money for example"<<endl;
cin>>bank.money1;
getline(cin,name);
money=bank.money1;

cout<<"Your money is RM "<<bank.money1<<endl<<endl<<endl;

cout<<"********************************\n\n"<<endl;
cout<<" Welcome to BankRupted\n\n\n";
cout<<"********************************"<<endl;

cout<<"\nPlease enter your password:"<<endl;
cin>>password;
getline(cin,name);
cout<<"Your password is valid!!\n";

do
{

cout<<"________________________________\n"<<endl;
cout<<" 1.Check your balance"<<endl;
cout<<" 2.Deposite"<<endl;
cout<<" 3.Withdraw"<<endl<<endl;
cout<<"________________________________\n"<<endl;
cout<<"Please enter your choice:\n";
cin>>choice;

switch(choice)
{

case 1:
{

cout<<"Your balance :RM "<<bank.money1<<endl;
break;

case 2 :

deposite();

break;

case 3:

withdraw();

break;
}
}
bank.money1=bank.balance;
cout<<"Do you want to continue(y=Yes/n=No)?"<<endl;
cin>>answer;


}while(answer=='y'||answer=='Y');

cout<<"________________________________"<<endl;
cout<<"Thank You for using our services"<<endl;
cout<<"Please come again"<<endl;
cout<<"********************************"<<endl;
return 0;


}
void deposite()
{


cout<<"You can only deposite note RM10, RM50 and RM100"<<endl;
long int x,f,t,e;
long int z;

cout<<"Enter the amount of money to be deposite: "<<endl;
cin>>z;

if(z>=20)
{
if(z!=30)
{
f=z/50;
x=z%50;
if(x!=20)
{
if (x==10||x==30)
{
f-=1;
x+=50;
}
}
t=x/10;
e=x%10;
if(e==0)
{
cout<<endl<<"No. of RM50 note : "<<f;
cout<<endl;
cout<<"No. of RM10 note : "<<t<<endl;
cout<<"TOTAL AMOUNT : "<<z<<endl;
bank.balance=z+bank.money1;

}

cout<<"Your balance is :RM "<<bank.balance<<endl;
}
}
}
void withdraw()
{

cout<<"Enter the amount of money to be withdraw:"<<endl;
cin>>bank.in;
if (bank.in<bank.money1)
{
cout<<"Your amount is :RM "<<bank.in<<endl;
bank.balance=bank.money1-bank.in;
cout<<"Your balance is :RM "<<bank.balance<<endl;
}
else
cout<<"not enough balance!!"<<endl;
}
You can put a pointer almost anywhere you want.

You'll have to be more specific about your question if you want us to help.
can you show me an example??
can the password use the pointer??
instead of the output came out the number,can it change into *??
You have to be more specific about what you mean. I have no idea what you're asking.

"use the pointer" is rather meaningless.
Topic archived. No new replies allowed.