0
I want to read a truth table from a txt file but it does not show anything of the file, nor the table numbers, nor any other character I have put to test
#include<iostream>
#include<STDIO.H>
using namespace std;
int main() {
int valor;
FILE *arquivo;
arquivo = fopen("tbV.txt","rt");
fscanf(arquivo, "%d", &valor);
fprintf ("%d", valor);
if(arquivo==NULL){
cout<<"Não foi possivel abrir o arquivo"<<endl;
}
fclose(arquivo);
}
Post at least one sample line of your file. It would be convenient if you were able to test whether or not to open the file before to use it and not to test after trying to use it.
– anonimo
Post the test file and the expected result. Wrote a program in C actually...
– arfneto