Returning multiple values from a C function

前端 未结 11 986
醉话见心
醉话见心 2021-01-18 08:05

Important: Please see this very much related question: Return multiple values in C++.

I\'m after how to do the same thing in ANSI C? Would you use a

11条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 08:43

    Returning a local copy of the structure is bad because if the struct was declared as non-static inside the function, it becomes null and void once you exit the function.

    And to all the folks suggesting references, well the OP did say "C," and C doesn't have them (references).

    And sweet feathery Jesus, can I wake up tomorrow and not have to see anything about the King of Flop on TV?

提交回复
热议问题