In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "the introduction of the default parameters of the function in c language". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the introduction of the default parameters of functions in c language".
1, all the default parameters of the function, when the function is defined or declared, all parameters are default.
# include / / XQuery y is the formal parameter of the function. If the function is called without setting x and y values, the x value defaults to 100, and the x value defaults to 5int sub (int x, 100) int Yee 5) {return (x Met y);} int main (void) {int adept 20; int baud 10; / / variables an and b are the arguments printf of the sub function ("sub function calculation result =% d\ n", sub (a, b)) / / Note: we have not set arguments for the sub function, so the default is "sub function =% d\ n", sub (); return 0;} / * output: sub function calculation result = 10sub function calculation result = 95 parameters /
2, the function semi-default parameters, when the function is defined or declared, only part of the formal parameters have default values.
# include / / XQuery y is the formal parameter of the function. If the y value is not set when the function is called, the y value defaults to 5 int sub (int Xreint yellow5) {return (XMY);} int main (void) {int aquifers 20; int banners 10; / / variables an and b are the arguments printf of the sub function ("sub function calculation result =% d\ n", sub (a, b)) / / Note: we did not set the argument for the second parameter of the sub function. At this time, the default is yroom5 printf ("sub function calculation result =% d\ n", sub (a)); return 0;} / * output: sub function calculation result = 10sub function calculation result = 15 arguments / so far, I believe you have a deeper understanding of the "introduction of function default parameters in c language". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.