Jump to content

Ler coluna e calcular media da mesma de um ficheiro csv


Ana Silva

Recommended Posts

  • 3 weeks later...

Eu neste momento tenho a apresentar o conteudo do ficheiro e guardá-lo na variavel texto, mas não sei o que fazer de seguida.

FILE * file;
    file = fopen(nome_ficheiro, "r");
    if(file == NULL){
        printf("Não foi possivel abrir o ficheiro");
        exit(0);
    }
    char texto[100];
    while(fgets(texto, 100, file) != NULL){
        printf("%s", texto);
    }

 

Edited by thoga31
GeSHi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.