面试
hitercch
这个作者很懒,什么都没留下…
展开
-
C语言使用联合体union和强制类型转换两种方法判断机器大小端
#include <stdio.h>union myunion{ int a; char b;};int main(){// 方法一,联合体 myunion d; d.a=0x12345678; printf("0x%x\n",d.b); if(d.b==0x78) { printf("小端\n"); } else if(d.b==0x12) { printf("大端\n").原创 2021-01-26 14:37:02 · 1248 阅读 · 0 评论 -
C语言链表反转完整版
#include <stdio.h>struct listNode{ int data; struct listNode* next;};struct listNode *ReverseList(struct listNode* head){ if (head==NULL || head->next==NULL) { return head; } struct listNode *previous=NULL;.原创 2021-01-26 11:20:35 · 864 阅读 · 0 评论