C語言中strlen和sizeof

定義 sizeof是C/C++中的一個運算符(關鍵字),計算對象或者類型在內存中所佔用的字節數。 strlen是C語言中的庫函數,計算字符串長度,不包括尾0。 引用頭文件#include<stdio.h>。 庫函數原型:size_t strlen(const char *s) 注:sizeof是關鍵字,不是函數。strlen是函數。web 舉例 char test[20] = 「hello」; c
相關文章
相關標籤/搜索