How to pass the whole structure into function? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

How to pass the whole structure into function?

Please explain elaborately how to pass structures to function and the prototype declaration is to be provided inside main or we can declare it outside main too?

1st Mar 2017, 3:29 PM
Utsuk Smile
Utsuk Smile - avatar
2 Respostas
+ 4
<return type> function_name( <structure name> variable_name, parameter 2... ) { } function call function_name(structure_variable);
1st Mar 2017, 3:41 PM
Megatron
Megatron - avatar
+ 1
Create an object of the structure... then pass it to the function by reference.
1st Mar 2017, 3:49 PM
Franky BrainBox
Franky BrainBox - avatar