How to pass the whole structure into function? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 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 ответов
+ 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