![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linuxc笔试面试题
文章平均质量分 58
Linux小学生1号
爱生活,爱自己,加油!
展开
-
Linuxc经典博文参考记录
1、C语言内存管理 https://www.cnblogs.com/yif1991/p/5049638.html原创 2021-01-09 16:19:05 · 66 阅读 · 0 评论 -
Linuxc笔试面试经典题(2)-内存题
#include #include <stdio.h> #include <stdlib.h> using namespace std; char *GetMemory(char *&p, int num) { p = (char *)malloc(sizeof(char)*num); //p = new char[num]; return p; } int main(void) { char *str ; GetMemory(str, 100); strcpy(str,原创 2021-01-09 16:14:26 · 347 阅读 · 0 评论 -
Linuxc笔试面试经典题(1)
1.找错题 试题1: void test1() { char string[10]; char* str1 = “0123456789”; strcpy( string, str1 ); } 忽略字符串后边的’\0’,拷贝到string时候会越界 试题2: void test2() { char string[10], str1[10]; int i; for(i=0; i<10; i++) { str1[i] = ‘a’; } strcpy( string, str1 ); } 试题3 void t原创 2021-01-09 16:09:48 · 577 阅读 · 0 评论