Write a function within certain requirements

0

Can anyone help me with the exercise below?

1) Write a function called update, which has no return (void), which will have four input parameters: (a) a pointer / reference to a DATA type structure (see below), (b) day, (c) an integer called month, and (d) an integer called year. This function should update the day, month, and year fields of the structure referenced by the first parameter of the function.

/* Estrutura DATA */
typedef struct
{
int dia;
int mes;
int ano;
} DATA;
/* Assinatura da função atualizar */
void atualizar(DATA* pontData, int dia, int mes, int ano) {
    
asked by anonymous 09.08.2016 / 01:32

1 answer

1
struct Data {
    int dia;
    int mes;
    int ano;
}

void Atualizar(Data** data, int dia, int mes, int ano) {
    (*data)->dia = dia;
    (*data)->mes = mes;
    (*data)->ano = ano;
}

Would that be it? If you need more information about what is happening, leave a comment that I explain. I'm out of time now, but any questions about the algorithm please let me know. Hugs !!

    
09.08.2016 / 01:39