0
i cannot understand two situations in c
1: https://scontent-mrs1-1.xx.fbcdn.net/v/t1.15752-9/44320783_1865864663469044_4922043292993978368_n.png?_nc_cat=100&_nc_ht=scontent-mrs1-1.xx&oh=021c06f06310eae04352dbc61d635ad1&oe=5C58B2FA 2: https://scontent-mrs1-1.xx.fbcdn.net/v/t1.15752-0/p280x280/44445876_245306326151497_1695753745314349056_n.png?_nc_cat=107&_nc_ht=scontent-mrs1-1.xx&oh=c50f7ed520df3c42b68d760fd76a82c7&oe=5C507FCE
4 ответов
0
Find examples and explanations here:
https://www.geeksforgeeks.org/format-specifiers-in-c/
Exactly, when we say passing array to the function, we mean that we pass pointer to its first element
+ 7
Answer to Q1:
%4.2f means you are printing floating point number upto two decimal places right justified by 4.
Number before decimal (4) is to justify output either to right or to left. Positive numbers will justify output to right and negative numbers will justify output to left.
Number after decimal (2) means that you want answer to be two decimal number. It simply means number of digits after decimal.
Answer to Q2:
Couldn't understand well what you are trying to ask, but there in the printf statement you are calling a function passing it the array and its size.
0
1) %4.2f - It is format specifier for float values, which means that float value will contain 4 symbols (minimum) in it and 2 of them will be for decimal part (after point symbol).
2) You pass 'orders' array to the function. No matter what is the name of your array, when you pass it to add_up() it will have name 'a' inside the function. It makes your code more flexible. Functions have their own variables which will be lost when function will be completed.
0
thank you...microBIG I understand from your answer (of the second question)that the array wasn't defined to the function so we identified it by a pointer ... and can you explain the first answer with some examples