4
Is there any difference in the use of these 3 statements?
void addCliente(struct cliente *dadosCliente){
dadosCliente[k].nome="oi";
(*(dadosCliente+k)).nome="oi";
(dadosCliente+k)->nome="oi";
}
void main(){
struct cliente clientes[1000];
addCliente(clientes);
}
How is the structure used?
nome
is a pointer, right?– Guilherme Bernal
No difference except for the readability. All will have the same effect.
– C. E. Gesser
The question is cool, but it’s not exactly about "statement" (or even "attribution") of strings, but about ways to access elements of a struct, isn’t it? In this case, I suggest editing at least the title to make it clearer.
– Luiz Vieira