Multi Arrays

Hi guys, im struggling with multidimentioal arrays. I have a basic understanding but I cant figure out how to make multi arrays with integers and strings. What I'm trying to do is making a multi arrays where there is employee names in one column and their salaries in the other. Here is what i got so far. line 20 is were the problem is.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>

using namespace std;

int main()
{
    class emp_data
    {
    private:
        
    public:
        int num_emp;
        string emp_name;
        int salaries;
        int dept;
    };
    
    string emp_name [4] = {"rashad", "tom", "mike", "ali"};
    int num_emp [string][4] = {{string emp_name},{100,200,300,400}};
    
    system("pause");
    return 0;
}
Last edited on
I don't think its possible but if it is every employee have 4 salary
Topic archived. No new replies allowed.