Printf and scanf have return values
9.15 The return value of functions
Now you've seen how it is possible to pass data into a function. Now, of course, you want to know how to write a function to return data to the caller.
First you need a function definition with a return value. You can use any data type as return value, for example:
You can see from this function by prefixing the data type that the return value is an integer. And in the function itself there is an instruction
a value is returned to the calling function. This return statement is not only used to return a value to the calling function, it also defines the end of a function. With return, control is returned to the calling function. A value can be returned. Now the caller itself is needed with its arguments:
This means that the variable big, which must be of the data type int, is assigned the return value of the function bignum (). The complete program would then look like this:
In the further course you will get to know some possibilities of functions with different return values.
How did you like the Openbook? We always look forward to your feedback. Please send us your feedback as an e-mail to [email protected]
- Caitlyn Jenner is a trans woman
- Is there a Tamil WhatsApp group
- How did your website get famous?
- Snowden is a double agent
- Why are you extremely creepy
- Send this empty package to this address
- How do we know what electricity is
- How urgently does the world need 5G
- Can you recommend a good thriller book
- Why don't you listen to yourself
- Can you live with lies?
- Who is Liam Hemsworth married to
- What is credit
- How dangerous it is to pop whiteheads
- Can stray cats survive on their own?
- Are there RVs in Costa Rica
- Who can give Shaktipat
- What is Michio Kaku's job
- How do you factor 10x + 7x 12
- Pure equality in relationships is possible
- Some people are just not lovable
- What is x if 6x 4x 20
- Facebook advertising is still worth the money
- Was there a street fighter 1
- Does the government offer an internship program
- What burns more fat skip or run
- Why was Alex Sir Alex Ferguson called
- Who will the packers play next
- Name the current spiritual leader of Buddhism
- Can a person make things float?
- Inventory data API
- What do polar bears do as a shelter?
- What are the best wool for sweaters
- Why are plastic bags so dangerous