Start New Discussion within our Software Development Community

I made several functions, and this one assignment keeps giving me "expected primary expression before '..., HELP!", what is a primary expression?, all my code is ok I have made different files for the different functions and im using extern but the void argument I think keeps giving me trouble its pointed out down in my code, where the word HERE is, that one line is giving me trouble, does anyone know what could I do pleaaase:

#include <iostream>
#include<stdlib.h>
#include <stdio.h>


   using namespace std;
   float horas, tarifa;

 void capturaDatos(char nombre[]);
 void salarioBruto(void);
 float impuestoINSS (float sBruto);
 float ImpuestoIR  (float sBruto);
 float salidaDatos(char nombre [], float sBruto,
                  float impINSS, float impIR);
  int main()
  { char nombre[30];
  int n, cont;
  float sBruto, ImpIR, impINSS;

     cout << "Ingrese la cantidad de trabajadores a procesar" << endl;
     cin>> n;
     cont = 1;
         while(cont <= n){
                capturaDatos(nombre);
                sBruto = salarioBruto(void); //<---- HERE!!!
                ImpIR = ImpuestoIR(sBruto);
                impINSS = impuestoINSS(sBruto);
                salidaDatos(nombre, sBruto, ImpIR, impINSS );
                cont = cont+1;
                          }
    system("PAUSE");
    return 0;
}

The function salarioBruto does not return any value - void salarioBruto(void); - so you cannot try to make it equal to sBruto.

Instead of
sBruto = salarioBruto(void);
write
salarioBruto();

This does now give the problem of how to calculate sBruto. I suggest you rewrite the function salarioBruto so make it return a value.

While I'm here,
Replace #include<stdlib.h> with #include<cstdlib>
Replace #include <stdio.h> with #include <cstdio>
Remove system("PAUSE"); completely.

This article has been dead for over six months. Start a new discussion instead.