//Hi all just switching from c++ to c#.Can anyone help,with the question i have:
//this is a peace of code from c++ banking aplication
int ShowMenu(void);
void AddAccount(vector<CAccount*>& list);
void DisplayAccount (vector<CAccount*>& list);
void Lodgement (vector<CAccount*>& list);
void Withdroawal (vector<CAccount*>& list);
void InterestRate (vector<CAccount*>& list);
CAccount* findAccount (vector<CAccount*>string );
bool quit = false;
int _tmain(int argc, _TCHAR* argv[])
{
vector<CAccount*> list;
int option = 0;
do{
quit =false;
option =ShowMenu();
switch ( option )
{
case 1:
AddAccount(list);
break;
case 2:
DisplayAccount(list);
break;
case 3:
Lodgement(list);
break;
case 4:
Withdroawal(list);
break;
case 5:
InterestRate(list);
break;
case 6:
quit = true;
break;
default:
cout << "Invalid Entry, Please Try Again";
}
}while(!quit);
return 0;
}
//How to change c++ vector to c# and what #include should be?Thank you.
PulsarScript
0
Junior Poster
Recommended Answers
Jump to PostIn C# you can think of all classes as references (pointers)
Like ddanbe said above, if you really want the pointer, you can use the
unsafe
keyword and then use it like C++. A more safe way is to marshall it out into anIntPtr
object, but this is generally …
Jump to PostShould not worry too much about abstract and protected.
Concentrate on the translation until you got …
Jump to PostDon't know exactlywhat you mean, but values that are typed in are lost when the program finishes, unless you implement some sort of filing.
Jump to PostC# has only one cast. If you want to cast a variable to a type you do
(Atype)Avariable
In the catch part you can write as many WriteLines as you like.
Jump to PostClick on my avatar and then on the code snippets link. Several snippets in the list are related to math. Or go directly clicking my snips
All 42 Replies
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
Ketsuekiame
860
Master Poster
Featured Poster
ddanbe
commented:
Could not have explained it better.
+15
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
PulsarScript
0
Junior Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
PulsarScript
0
Junior Poster
PulsarScript
0
Junior Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
PulsarScript
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.