I started learning C++ this morning using various tutorials, I want to make something for the gp32 (eventually)
Anyway, this is the code im working on at the moment:
I need to know how to do an IF command that asks whether
a = div
I tried using the method I use for say 'a = 5', but it doesnt work!
Should I be using a different variable type? please help
Anyway, this is the code im working on at the moment:
Code:
//basic input/output file thing...
#include <iostream.h>
//main code
int main ()
//start main code block
{
//welcome messages
cout << "Welcome to my C++ calculator.\n";
cout << "I hope it works for you ^_^.\n";
cout << "Choose a function (add, dov, mul, sub).\n";
char a[3];
cin >> a;
cout << "You chose calculator function " << a << ".\n";
cout << "Ok, now which number do you want to " << a << "?.\n";
int b;
cin >> b;
cout << "Right, now what do you want to " << a << " with " << b << "?.\n";
int c;
cin >> c;
cout << "I have used " << b << " and " << c << " and used the " << a << " function, here is the resulting integer:\n";
//IF commands to determine what function you used, and the resulting integer
//end main code block
}
I need to know how to do an IF command that asks whether
a = div
I tried using the method I use for say 'a = 5', but it doesnt work!
Should I be using a different variable type? please help