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 <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){
                sBruto = salarioBruto(void); //<---- HERE!!!
                ImpIR = ImpuestoIR(sBruto);
                impINSS = impuestoINSS(sBruto);
                salidaDatos(nombre, sBruto, ImpIR, impINSS );
                cont = cont+1;
    return 0;
5 Years
Discussion Span
Last Post by Moschops

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);

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.

Edited by Moschops: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.