-2
I need your help, I have several files. txt with text and I want my program to ask the user for the filenames and store the contents in memory and then display their contents. I made some code but I can only see the contents of the first file. You can help me?
#include <iostream>
#include <fstream> 
#include <iomanip>
#include <string>
#include<stdio.h>
#include <sstream>
using namespace std;
int main()
{
    setlocale(LC_ALL, "portuguese");
    ifstream arquivoe; 
    string ficheiro[] = {""};
    string linha;
    char condicao='s';
    int tamanho = sizeof(ficheiro) / sizeof(string);
    
    for (int i = 0; i < tamanho; i++)
    {
        while (condicao == 's' || condicao == 'S')
        {
            cout << ("Introduza o nome do ficheiro que deseja armazenar: ");
            cin >> ficheiro[i];
            arquivoe.open(ficheiro[i]); // abertura do .txt a partir do metodo.open.
            cout << ("Pretende continuar a armazenar ficheiros[S/N]? ");
            cin >> condicao;;
            system("CLS");
        }
    }
        
    if (arquivoe.is_open()) {
        while (getline(arquivoe, linha))
        {
            cout << linha << endl;
        }
    }
    else
    {
        cout << ("Não foi possivel abrir arquivo");
    }
    return 0;
}