Gets the number of rows and columns from the input stream. If rows <= MAX_ROWS and cols <= MAX_COLS, fills m with data from file; otherwise signals failure on stream is and sets m size to 0 x 0

What will be an ideal response?


```
istream& operator>> ( istream& is, Matrix& m )
{
int i, j;

is >> m.rows >> m.cols;
if (is.fail()) {
m.rows = 0;
m.cols = 0;
} else if (m.rows > MAX_ROWS || m.cols > MAX_COLS) {
is.setstate( ios::failbit );
m.rows = 0;
m.cols = 0;
} else {
for (i = 0; i < m.rows; ++i)
for (j = 0; j < m.cols; ++j)
is >> m.mat[i][j];

if (is.fail()) {
m.rows = 0;
m.cols = 0;
}

}
return is;

}

```

Computer Science & Information Technology

You might also like to view...

Internet Explorer's ____ filter also can be used to create gradient effects in which a page object appears to fade away in a linear, radial, or rectangular direction.

A. Opera B. Alpha C. Beta D. WebKit

Computer Science & Information Technology

A mask requires two layers: a Mask layer, and a Masked layer. Which one appears above the other on the Timeline?

What will be an ideal response?

Computer Science & Information Technology

If you use a repair shop, there is no need to ask them to demonstrate that a problem has been resolved

Indicate whether the statement is true or false

Computer Science & Information Technology

________ is an I/O-performance-enhancement technique—it reduces the number of I/O operations by combining smaller outputs together in memory; the number of physical I/O operations is much smaller than the number of I/O requests issued by the program.

a. Aggregating b. Accumulating c. Amassing d. Buffering

Computer Science & Information Technology