I have a global variable called: char clientes_dni[]. I am calling (from the main) a function like: comprobarExistenciaDNI(clientes_dni). My function comprobarExistenciaDNI is:
bool comprobarExistenciaDNI(char DNI[]) {
/// Change to lower DNI last word
DNI[8] = tolower(DNI[8]);
return (true);
}
If my var has the value '11111111J', after function the value is '11111111j'. I am not working with global variable, only with the local variable so... Why value of clientes_dni is changed?
Thank you.
, so when callingtolower()` the result is being assigned to that global variable.