Question: * Convert a given char array into an integer vector * * Example input: * - [ t , c , q , v ,

* Convert a given char array into an integer vector
*
* Example input:
*-[ t, c, q, v, j ]
*
* Example output:
*-{116,99,113,118,106}
*/
Here is what I have so far... but the return that comes back has a ton of numbers instead of just 5(the amount that corresponds with the input)
static vector Test7(char letters[])
{
//create a vector to hold the results
vector result;
//create a loop to loop thru the letters
for (int i =0; letters[i]!=0; i++){
result.push_back(static_cast(letters[i]));
}
return result;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!