Hello I'm just starting C++ and I'm a bit confused with how to store strings in an array. I'm trying to make a simple calculator and this is what I've got so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main()
{
int op, fn, sn;
string type[] = {addition, subtraction, multiplication, division}
cout << "This is a calculator. Press:\n0 for addition\n1 for subtraction\n2 for multiplication\n3 for division\nPlease enter the operation you wish to use: ";
cin>>op;
cout << "You have chosen: "<< type[op] <<".";
cout << "Please enter the first number to start:";
return 1;
}
Can anyone explain to me why I get the error "not declared in scope"?