How to add a string to array in a simple way - C++ : <p>So I have this problem my teacher gave me which is: Enter the names and salaries of 5 employees into two arrays and print the name of the employee who has the highest salary.</p>

<p>Im not sure how to input a string to an array and link it to the other array, this is what I wrote:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;


int main()
{
int salary, x, y;
string name;
int Arr1[5];
int Arr2[5];
x = 0;
y = 0;
for (int i = 0; i &lt;= 5; i++) {
    cin &gt;&gt; Arr1[name];
    cin &gt;&gt; Arr2[x];
    if (x &gt; y) {
        x = y;
    }
}
cout &lt;&lt; "Employee" &lt;&lt; Arr1[name]&lt;&lt; "has the biggest salary of:" &lt;&lt; y &lt;&lt; endl;
return 0;
}
</code></pre>
