不会的题目
以下描述不正确的是( )。
宏名无类型
宏替换不占用运行时间
宏名必须用大写字母表示
宏替换只是字符替换
在“文件包含”预处理语句的使用过程中,当#include后面的文件名用双引号括起来时,寻找被包含文件的方式是( )。
直接按系统设定的标准方式搜索目录
先在源程序所在目录搜索,再按系统设定的标准方式搜索
仅仅搜索源程序所在目录
仅仅搜索当前目录
#include<stdio.h>
int main(void)
{
int x[5] = { 2, 4, 6, 8, 10 }, *p, **pp;
p = x;
pp = &p;
printf(“%d ”, *(p++));
printf(”%d\n”, **pp);
return 0;
}
4 4
2 4
2 2
4 6
对于以下变量定义,正确的赋值是()。
int *p[3], a[3];
p = a
*p = a[0]
p = &a[0]
p[0] = &a[0]
#include <stdio.h>
#include <string.h>
char *fun(char *t)
{
char *p = t;
return (p+strlen(t)/2);
}
int main(void)
{
char *str = “abcdefgh”;
str = fun(str);
puts(str);
return 0;
}
abcdefgh
abcd
efgh
fgh
int fun(char s[ ])
{ int n=0;
while(*s<='9'&&*s>='0') {n=10*n+*s-'0'; s++;}
return(n); }
int main(void)
{
char s[10]={'6', '1', '*' , '4', '*', '9', '*', '0', '*'};
printf("%d\n",fun(s));
return 0;
}
char *fun(char *t)
{ char *p=t;
return (p+strlen(t)/2); }
int main(void)
{ char *str=“abcdefgh”;
str=fun(str);
puts(str);
return 0; }