[Error] no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(const string&)'
Publicado por Leei (2 intervenciones) el 21/04/2020 11:48:09
Hola me pregunto, por qué me sale error cuando creo una constante para el nombre del archivo, el error en la linea 10:
[Error] no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(const string&)'
y cuando uso directamente el nombre "valores.txt" si anda
[Error] no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(const string&)'
y cuando uso directamente el nombre "valores.txt" si anda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <sstream>
#include <fstream>
using namespace std;
const string NUMEROS = "valores.txt";
const string NUM_PRIMOS = "primos.txt";
int main(){
ifstream archivoDeNumeros(NUMEROS);
ofstream archivoDePrimos(NUM_PRIMOS);
return 0;
}
Valora esta pregunta


0