随笔分类 -  C语言相关

摘要:download from gcc's ftp webpage # install some prerequisites. Note that a usable gcc is in build-essential. sudo apt install build-essential libmpfr-d 阅读全文
posted @ 2024-06-10 21:07 火焰龙卷风 阅读(202) 评论(0) 推荐(0)
摘要:今天看一段C语言代码有一个比较陌生的感觉: int a[100]; if (a == &a){ printf("True\n"); } else { printf("False\n"); } 结果自然是True,但是我不知为何有一种感觉就是a这个名字应该自己有一个占据的空间,然而,这种感觉是错误的。 阅读全文
posted @ 2024-05-30 01:24 火焰龙卷风 阅读(10) 评论(0) 推荐(0)
摘要:比如下面这段代码: char str[3][3] = {"aa","bb","cc"}; char** p = str; char* s1 = str[0]; char* s2 = p[0]; 有什么问题? 我们来看实际的内存布局,str是一个多维数组,它的尺寸实际上是3*3=9个char。 也就是 阅读全文
posted @ 2024-05-18 18:13 火焰龙卷风 阅读(20) 评论(0) 推荐(0)