At the code below there is a simple function with these errors:
gastos.cpp:13:6: error: variable has incomplete type 'void'
gastos.cpp:13:50: error: expected ';' after top level declarator
can you guys identify where the error is? Thanks!
1 2 3 4 5 6 7 8 9 10
void extrato(Produto* vetor, int qtd, string you){
cout << "Extrato referente ao usuario : " << you << endl;
float total = 0;
for (int i = 0; i < qtd; i++){
cout<<vetor[i].nome<<"____"<<vetor[i].preco<<endl;
total+=vetor[i].preco;
}
cout << "total___" << total << endl;
}
Your line numbers don't match up to your actual code. Most likely you forgot to #include something because it's complaining about an incomplete type. If it isn't too long, can you post the beginning of the file up to the function, and where you call it from?
Otherwise, make a copy of your code and delete any extraneous code that doesn't contribute towards the error.