Jump to content
Fórum Script Brasil
  • 0

Adicionar Arquivos


Leonardo Prass
 Share

Question

Como Adicionar um Arquivo de texto em c++ ex, eu Digito o nome do arquivo e ele procura e o abre  como faco? esse codigo abre um arquivo de texto comum sem acentos.

#include <iostream>
#include <string.h>
#include<stdlib.h>
#include<stdio.h>
#include <fstream>
using namespace std;
int main() {
using namespace std;

ifstream entrada;
#include <fstream>
char frase;
entrada.open("leo.txt");//NOME DO ARQUIVO QUE ELE ABRIRA
entrada.get(frase);
while(!entrada.eof()){

while(frase!='\n' && !entrada.eof()){
cout<<frase;

entrada.get(frase);
}

if(!entrada.eof())
entrada.get(frase);
}
entrada.close();}

 

EXEMPLO DO QUE EU QUERO 

COUT<<"DIGITE O NOME DO ARQUIVO ";

CIN>>lENDO ARQUIVO ;

COUT<<MOSTRA AQUI O ARQUIVO IMPRIMIDO;

COMO FACO ISSO? OBRIGADO

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.6k
    • Total Posts
      646.2k
×
×
  • Create New...