C++ I need to change an array that has rows and columns to "*" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C++ I need to change an array that has rows and columns to "*"

If I have an array with 3 rows and 3 columns (the rows are numbers and the columns are letters)and I want to ask the user to input the row and column then change that '*'.

27th Nov 2020, 11:12 PM
Julie Ann
Julie Ann - avatar
3 Answers
+ 1
int col; char charCol; //#################################### // your code to get the row goes here' //#################################### puts("Enter column a, b or c?"); switch(tolower(charCol = getchar())){ case 'a': col = 0; break; case 'b': col = 1; break; case 'c': col = 2; } myarr[row][col] = '*'; //< example only. Bounds checking is up to you.
28th Nov 2020, 1:39 AM
rodwynnejones
rodwynnejones - avatar
0
The question is unclear
28th Nov 2020, 12:17 AM
Davide
Davide - avatar
0
Thanks. Both were helpful and I was able to figure it out.
7th Dec 2020, 1:20 AM
Julie Ann
Julie Ann - avatar