
以下是题主参加的一家偏向Linux平台开发的公司软件岗位笔试题,分享原题,后面附上题主91分的部分参考答案^V^)
一、(8分)请问一下程序输出什么结果?
char *getStr(void)
{
char p[] = "hellow world";
return p;
}
void test(void)
{
char *str = NULL;
str = getStr();
printf(str);
}
二、(5分)test2函数有问题吗,如果有,请支出问题出在什么地方并给出正确答案。
void test2()
{
char string[10], str[10];
int i;
for(i = 0; i <p>三、(5分)用预处理指令#define 声明一个常数,用以表明一年中有多少秒。(忽略闰年问题)</p><p>四、(5分)写一个“标准”宏MIN,这个宏输入两个参数并返回较小的一个。</p><p>五、(8分)你怎么样用C编写死循环呢?</p><p>六、(10分)用变量a给出下面的定义:</p><p>1、一个整型数;</p><p>2、一个指向整型数的指针;</p><p>3、一个指向指针的指针,它指向的指针是指向一个整型数;</p><p>4、一个有10个整型数的数组;</p><p>5、一个有10个指针的数组,该指针是指向一个整型数的;</p><p>6、一个指向有10个整型数数组的指针;</p><p>7、一个指向函数的指针,该函数有一个整型数参数并返回一个整数;</p><p>8、一个有10个指针的数组,该指针指向一个函数,该函数有一个整型参数并返回一个整型数;</p><p>七、(5分)关键字static的作用是什么?</p><p>八、(10分)关键字const有什么含意?</p><p>下面的声明都是什么意思?</p><div class="aritcle_card flexRow artxards">
<div class="artcardd flexRow">
<a class="aritcle_card_img" rel="nofollow" href="/ai/1017" title="AssemblyAI"><img
src="https://img.php.cn/upload/ai_manual/000/000/000/175680070344595.jpg" alt="AssemblyAI" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a rel="nofollow" href="/ai/1017" title="AssemblyAI" class="overflowclass">AssemblyAI</a>
<p class="overflowclass">AssemblyAI是一款为开发者提供语音转文字、语音理解和语音 Agent API 的 Speech AI 平台。</p>
</div>
<a rel="nofollow" href="/ai/1017" title="AssemblyAI" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span>
</a>
</div>
</div><p>1)const int a;</p><p>2)int const a;</p><p>3)const int *a;</p><p>4)int *const a;</p><p>5)int const *a const;</p><p>九、(5分)下面的代码输出是什么?为什么?</p><pre class="brush:php;toolbar:false">void foo(void)
{
unsigned int a = 6;
int b = -20;
(a - b > 6) ? puts(">6") : puts("<p>十、(5分)动态分配内存可能发生的问题是什么?</p><p>十一、(5分)volatile这个关键字的作用是什么?</p><p>十二、(8分)进程之间进行通信的方式有几种,它们分别是什么?</p><p>十三、(8分)请写出下面的程序的输出结果:</p><pre class="brush:php;toolbar:false">#include<stdio.h>
int main()
{
int a = 10, b, c, d;
b = a++;
c = ++a;
d = 10 * (++a);
printf(" b : %d , c:%d, d :%d ", b , c, d);
return 0;
}</stdio.h>
十四、(5分)进程和线程的区别是什么?
十五、(8分)请列举四种位运算符,并说明它们一般用于什么地方。
部分参考答案:


推荐:《c语言教程》
13万字C语言保姆级教程(深入):立即使用
在学习笔记中,你将探索c语言的核心概念和高级技巧!










