C++常考易错笔试面试题
yanghui_429
这个作者很懒,什么都没留下…
展开
-
常见的排序算法
#include <iostream>void dataSwap(int* a, int* b);void Bubble_Sort(int* arr, int len);void Insert_Sort(int* arr, int len);void Selection_Sort(int* arr, int len);void MergeS(int* arr, int low...原创 2017-09-26 09:54:51 · 296 阅读 · 0 评论 -
C++面试宝典笔试题记录
笔试题代码删除单向链表中的某个节点struct listNode{ int key; listNode* next;};listNode* deleteNode(listNode* head, int target){ listNode* node1 = head; listNode* node2 = NULL; if (node1->key ==原创 2017-10-07 22:26:32 · 546 阅读 · 0 评论 -
C/C++语法
1. 关于strcpy char str1[5]; char* str2= "01234"; strcpy( string, str2);以上代码会出现什么问题:str1需要6个字节才能存放下str1的内存,而str1定义的大小为5,因此会出现数组越界。 char str1[5], str2[5]; int i; for(i=0; i<5; i++) { str1 = 'a'; }原创 2017-09-23 21:12:37 · 565 阅读 · 0 评论