帮我找一套C语言得面试题
时间: 2023-07-31 11:12:36 浏览: 22
好的,以下是一些C语言面试题,希望能对你有所帮助:
1. 什么是指针?指针和变量有什么区别?
2. 如何将一个整数转换成字符串?
3. 请解释下列代码的输出结果:
```
#include <stdio.h>
int main()
{
int a=2,b=3,c=4,d=5,e=6;
printf("%d\n",a+++b+c+++d+e);
return 0;
}
```
4. 请写一个函数,实现字符串反转。
5. 请写一个函数,判断一个字符串是否为回文字符串。
6. 请解释下列代码的输出结果:
```
#include <stdio.h>
int main()
{
char str[] = "hello";
printf("%c\n",str[5]);
return 0;
}
```
7. 请写一个程序,统计字符串中大小写字母、数字和其他字符的个数。
8. 请解释下列代码的输出结果:
```
#include <stdio.h>
int main()
{
int a[] = {1,2,3,4,5};
int *p = (int *)(&a+1);
printf("%d,%d\n",*(a+1),*(p-1));
return 0;
}
```
9. 请写一个程序,实现两个整数的交换。
10. 请解释下列代码的输出结果:
```
#include <stdio.h>
#define A 10
#define B A+1
int main()
{
printf("%d,%d\n",A,B);
return 0;
}
```
希望以上面试题能对你有所帮助,祝好运!
相关推荐














