Small error with a function

Hi everyone, thank you for your time, Im making a small program, but I cant seem to get arround this error. its proabably something silly im missing, but ive checked about 5 times and im still missing it...
Variable names are in spanish sorry, but i guess thats not really important

period.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef PERIODOacademico_H_INCLUDED
#define PERIODOacademico_H_INCLUDED

class Periodo{
private:
    char clave;
    int anio;

public:
    Periodo( char cClave, int iAnio)
    {

        clave=cClave;
        anio=iAnio;
    }

    void setClave(char cClave){clave=cClave;}
    void setAnio(int iAnio){anio=iAnio;}
    char getClave(){return clave;}
    int getAnio(){return anio;}
};


#endif // PERIODOacademico_H_INCLUDED


group.h here is where the error happens
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef GRUPO_H_INCLUDED
#define GRUPO_H_INCLUDED

#include "Periodoespecial.h"
class Grupo{

private:
    int claveMat, numGrupo, idMaestro;
    Periodo periodoAcademico;

public:
    Grupo(int iClaveMat, int iNumGrupo, int iIdMaestro, Periodo pPeriodoAcademico)
     { // im getting the error on this line
     claveMat=iClaveMat;
     numGrupo=iNumGrupo;
     idMaestro=iIdMaestro;
     periodoAcademico =pPeriodoAcademico;
    }

    void setClaveMat(int iClaveMat){claveMat=iClaveMat;}
    void setNumGrupo(int iNumGrupo){numGrupo=iNumGrupo;}
    void setIdMaestro(int iIdMaestro){idMaestro=iIdMaestro;}
    void setPeriodoAcademico(Periodo pPeriodoAcademico){periodoAcademico =pPeriodoAcademico;}
    int getClaveMat(){return claveMat;}
    int getNumGrupo(){return numGrupo;}
    int getIdMaestro(){return idMaestro;}
    Periodo getPeriodoAcademico(){return periodoAcademico;}
};



#endif // GRUPO_H_INCLUDED


 


Your Periodo object constructor only takes arguments when it is instantiated.

Periodo( char cClave, int iAnio)

But you try to instantiate a Periodo object without arguments
Last edited on
Topic archived. No new replies allowed.