![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
边角
Jasablanca
这个作者很懒,什么都没留下…
展开
-
动态分配的数组使用sizeof()
#include <stdio.h> #include <string.h> #include <algorithm> int main() { int a[5]={0,1,2,3,4}; int *b; b=(int *)malloc(5*sizeof(int));//malloc需要调用<algorithm> me...原创 2019-05-07 15:08:03 · 1910 阅读 · 1 评论 -
error: expected primary-expression before 'int'
a=(int *)malloc(sizeof(int*aSize)); 写代码的时候出现 error: expected primary-expression before 'int' 应该不会只有我这么蠢把malloc()函数写错了吧。 改正: a=(int *)malloc(sizeof(int)*aSize); 不过我觉得为了避免迷糊,还是把aSize放在前面吧。 a=(int *)m...原创 2019-05-07 15:18:51 · 20444 阅读 · 0 评论 -
typedef与struct
typedef与struct typedef struct ListNode { int data; struct ListNode *next; }Node,*List_Pointer; 其实就是 struct ListNode { int data; struct ListNode *next; }; 加上 typedef struct ListNode N...原创 2019-05-10 19:49:52 · 122 阅读 · 0 评论