error: no matching function for call to 'getline(FILE*&, std::string&)' Function code:
void CarregarArquivo(){
aluno alunos_auxiliar[MAX];
FILE *arquivo;
arquivo=fopen ("texto.txt","r");
int quantidade=0;
fscanf(arquivo,"%d",&quantidade);
if(quantidade!=0){
quantusuario=quantidade;
for(int i=0;i<quantidade;i++){
getline(arquivo,alunos[i].nome);
fscanf(arquivo,"%d",&alunos[i].matricula);
printf("%d",alunos[i].matricula);
fscanf(arquivo,"%d/%d/%d",&alunos[i].nascimento.dia,&alunos[i].nascimento.mes,&alunos[i].nascimento.ano);
if(alunos[i].numero!=0){
for(int j=0;j<alunos[i].numero;j++){
getline(arquivo,alunos[i].materias[j].nome);
fscanf(arquivo,"%.1f",&alunos[i].materias[j].nota);
}
}
}
}
else if(quantidade == 0 && arquivo == NULL){
quantusuario =0;
}
fclose(arquivo);
}
includes:
registro.h has structs in there:
struct aluno{
string nome;
int numero;
int matricula;
data nascimento;
disciplina materias[10];
};
includes:
#include"registros.h"
#define MAX 100
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include"funcoes.h"
#include <fstream>
#include<string>
Getline please work.
I'm Brazilian.Ignore the name of variables. Sorry about my English.