how i can make a list ,that has(1,2,3,4) ?
i want this because i want to make a quiz with possibly answers!!!
char array4[4]={1:'apw',2:'ddaase',3:'2',4:'5'};
That will only work if you use C++11. If you don't, you can do it this way instead:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <map>
#include <string>
#include <iostream>
using namespace std;
int main()
{
map<int,string> a;
a[1] = "apw";
a[2] = "ddaase";
a[3] = "2";
a[4] = "5";
cout << a[2];
}
|
Last edited on
it runs,but i dont want to be in output(apwddaasee25)
but something like this(1:apw,2:ddasse,3:2,4:5) ,so what should do?