# 01 · ctypes-libc **演示**:用 `ctypes.CDLL` 加载系统 libc,声明 `strlen` 的 `argtypes`/`restype`,直接调用 C 函数;`"你好"` 的 UTF-8 字节数是 6,不是 2。 **运行**: ```sh uv run python examples/25-c-extensions-ctypes-cffi/01-ctypes-libc/ctypes_libc.py ``` **预期输出**(3.12.9 / macOS): ```text strlen('hello'): 5 strlen('你好'): 6 ``` **依赖**:仅标准库。 **注意**:必须声明 `argtypes`/`restype`,否则默认按 `int` 传参/返回,指针和 64 位整数会被截断。`strlen` 统计的是字节数,不是字符数。