码迷,mamicode.com
首页 >  
搜索关键字:sizeof    ( 5917个结果
c语言数据结构---动态链表操作
#include <stdio.h> #include <stdlib.h> #include <string.h> //#define LEN sizeof(LinkedList); typedef struct Student{ int score; char name[10]; struct ...
分类:编程语言   时间:2020-02-15 15:15:57    阅读次数:70
算法复习:链表
链表必须清楚掌握 链表定义 struct ListNode { int val; ListNode *next; }; 创建链表头 ListNode* creat()//创建头 { struct ListNode *node=(struct ListNode *)malloc(sizeof(stru ...
分类:编程语言   时间:2020-02-15 13:42:51    阅读次数:72
sizeof运算符、strlen()函数和转义字符
本篇文章posted on 2019-12-23 12:58 本人之前写过一篇类似的文章(链接:sizeof运算符和strlen()函数),也比较深入,但是和本篇相比,本篇更加深入。 首先请看下面的代码,这个代码应该输出什么。 下面是C语言代码。 1 #include<stdio.h> 2 3 in ...
分类:其他好文   时间:2020-02-15 13:09:26    阅读次数:79
二刷斐波那契高精度
#include<bits/stdc++.h> using namespace std; struct bign{ int d[10000]; int len; bign(){ memset(d,0,sizeof(d)); len = 0; } }; //字符串转到大数中 bign change(c ...
分类:其他好文   时间:2020-02-14 22:55:40    阅读次数:97
树状数组
树状数组不难理解,学的还算轻松,它的核心就是一个lowbit的运用,学之前还特地把位运算重新学了一遍。 //位运算符:& | ^ ~ << >> int a1=60,b1=13; //在二进制中, //a=00111100 //b=00001101 int c1=a1&b1;//对应每一位做与运算, ...
分类:编程语言   时间:2020-02-14 22:13:53    阅读次数:87
[Usaco2017 Open]Bovine Genomics
Farmer John owns Ncows with spots and N cows without spots. Having just completed a course in bovine genetics, he is convinced that the spots on his c ...
分类:其他好文   时间:2020-02-12 18:15:58    阅读次数:70
luogu P3355 骑士共存问题
本题和方格取数一样,也可以分成黑白点,本题加上特判一个点是否有障碍即可,其余和那题没什么区别,挂一下大佬的证明(二分图最大独立集) #include<bits/stdc++.h> using namespace std; #define lowbit(x) ((x)&(-x)) typedef lo ...
分类:其他好文   时间:2020-02-12 16:49:24    阅读次数:96
POJ 3352 Road Construction
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #define maxn 1005 using namespace std; int num,to[maxn<<1],nxt[maxn<<1],last[ma ...
分类:其他好文   时间:2020-02-11 17:35:13    阅读次数:63
c++踩坑大法好 数组
1,c++遍历数组 int数组和char数组不同哦,int占4位,char占1未,同理double也不同。基本遍历方法: int mylist[4] = { 1,2,3,4 }; int mylistlen = sizeof(mylist) / sizeof(mylist[0]); printf(" ...
分类:编程语言   时间:2020-02-11 14:45:31    阅读次数:66
深入理解 C/C++ sizeof() 运算符
过去有一段时间一直以为带个括号的 sizeof() 是 C/C++ 的原生函数QAQ。 其实不然,sizeof 同位运算符(^|&~!)一样是一种单目运算符,作用于变量或数组。 在编译时编译器就会把 sizeof() 的内容转换成常数存入机器码中,不涉及函数的底层操作。 用途 sizeof 运算符可 ...
分类:编程语言   时间:2020-02-11 14:39:11    阅读次数:86
5917条   上一页 1 ... 39 40 41 42 43 ... 592 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!