ft_strlen
1.プロトタイプ
size_t ft_strlen(const char *str)
#include <string.h>
size_t strlen(const char *s)
#inlcude
サイズを表す変数として使用します.
最大サイズの符号なしデータ型を理論的に含めることができる.
すなわち、32ビットマシンでは32ビットの符号なし整数型(符号なし整数ではなく「整数」)が、64ビットマシンでは64ビットの符号なし整数型(符号なしlong long)が
2.用途
パラメータは文字列の長さの関数を渡します.
3.戻り値
パラメータとして渡される文字列の長さを返します.
4.コード実装
#include "libft.h"
size_t ft_strlen(const char *str)
{
size_t t;
t = 0;
while (str[t] != '\0')
t++;
return (t);
}
5.コード説明
Reference
この問題について(ft_strlen), 我々は、より多くの情報をここで見つけました https://velog.io/@kimnawoon/ftstrlenテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol