1.What will be the output of the program? Explanation: So the 2 in the first function represents that there are 2 arguments. And 3 in second function represents there are 3 arguments. So first it prints 4 and 8. Next, it will print 6, 9, 7. Excluding 4 and 8. 2.Which of the following statements are FALSE about the below code? [A]. ac contains count of arguments supplied at command-line#include<stdio.h> #include<stdarg.h> void dumplist(int, ...); int main() { dumplist(2, 4, 8); dumplist(3, 6, 9, 7); return 0; } void dumplist(int n, ...) { va_list p; int i; va_start(p, n); while(n-->0) { i = va_arg(p, int); printf("%d", i); } va_end(p); printf("n"); }
In the list, the first parameter always represents the number of arguments to be passed.
4 and 8 are actually to define a number of parameters. And they are not get printed.int main(int ac, char *av[]) { }
[B]. av[] contains addresses of arguments supplied at a command line
[C]. In place of ac and av, argc and argv should be used.
[D]. The variables ac and av are always local to main()
Explanation:
Answer C is not correct for this question. According to Posix standard and other standards for declaring variable names, variable name can be any valid variable name. In this case we can use ac and av instead of argc and argv since these are only variable names for argument counter and argument vectors of command line argument.
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算