There are a few different approaches to "reading user input".
Which one works best, depends a little on the format/style of input. You can consider two different formats, "Linebased" and "free form". Free form would be input like C source code where you can add newlines, spaces, etc wherever you like.
Linebased has a set format, where each line contains a given set of inputs [not necessarily the same number of inputs, but the end of line terminates that particular input].
In a free-form input, you would have to read a character, then determine "what the meaning of this particular part is", and then decide what to do. Sometimes you also need to use the peek() function to check what the next character is, and then determine what to do based on that.
In a line-based input, you use getline() to read a line of text, and then split that into whatever format you need, for example using stringstream.
Next you have to decide whether you write your own code (or use some basic standard translation code) or use stream functions to parse for example numbers. Writing some more code will get you better ways to handle errors such as "1234aqj" isn't a number, but stream would simply stop reading when it reaches 'a' in that string.
rows? Anint?cstdlib? Because that looks like<istream>for meignoreCharis a digit, thenrows = ignoreChar - '0';will workrowsis declared before. I asked what is it declared like. Anint?