0
I am trying to pass a char array pointer to a function. I want it to make changes to this char array.
Follow the function code:
void dhnfe( char tzd, char hverao, char *dh)
{
if (hverao == 1)
{
switdh(tzd)
{
case -2: /*Fuso de Fernando de Noronha */
dh = "%Y-%m-%d-T-%H:%M:%S-2:00";
break;
case -3: /*Fuso de Brasilia*/
default:
dh = "%Y-%m-%d-T-%H:%M:%S-3:00";
break;
case -4: /*Fuso de manaus*/
dh = "%Y-%m-%d-T-%H:%M:%S-4:00";
break;
}
}
else if (hverao == 0)
{
switdh(tzd)
{
case -2: /*Fuso de Fernando de Noronha Horario de Verao*/
dh = "%Y-%m-%d-T-%H:%M:%S-1:00";
break;
case -3: /*Fuso de Brasilia Horario de Verao*/
default:
dh = "%Y-%m-%d-T-%H:%M:%S-2:00";
break;
case -4: /*Fuso de Manaus Hoario de Verao*/
dh = "%Y-%m-%d-T-%H:%M:%S-3:00";
break;
}
}
}
The types of the parameters would not be
signed char
andchar
?– mercador
What is
dhar
??– Francisco
Actually it was a typo, they’re "char"
– Gabriel Lampa