c/c++ sizeof與strlen的區別

#include<stdio.h> #include<stdlib.h> #include<string.h> #include<stddef.h> void test01() { //sizeof統計 \0,strlen不統計\0,遇到\0就結束 char str[] = "hello\012world"; // \012是八進制,下轉十進制10,在ASCII表中是換行 printf("
相關文章
相關標籤/搜索