This program asks for integers from the user and stores them into a multidimensional array that adjusts its size.
This snippet sets aside far more memory than is required, mainly due to the fact that both xsize and ysize are continuously incremented without any checks. Used this way, xsize represents the total number of integers typed in (off by one), not the total number of rows. Type in the following:
1 r 2 r 3 r 4 r [B]s[/B]
and you end up with a 5 x 5 array rather than a 1 x4 array.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.