Answer the question
In order to leave comments, you need to log in
How to output an array?
Tell me how to display an array, only the part that is initialized? For example, the length of the array is 100,
and the user entered only 5 elements. you need to display only these 5 elements and not the entire array.
for example this code.
int main()
{
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str[200];
for (int i = 0; i < 200; ++i)
{
getline(cin, str);
}
//Как вывести например только 5 введенных строк???
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question