
好词典

缩写自'pointer',源自拉丁语'punctum'(点),通过古法语'pointur'演变而来。
❶ PTR是'pointer'的缩写形式,在计算机编程中表示指向内存地址的变量,用于间接访问数据。
“The function returns a ptr to the allocated memory.”
(该函数返回指向分配内存的指针。)
“Always check if a ptr is null before dereferencing it.”
(在解引用指针前务必检查它是否为null。)
null ptr — 表示未指向有效内存地址的空指针,解引用会导致程序崩溃。
“Dereferencing a null ptr will cause a segmentation fault.”
(解引用空指针会导致段错误。)
ptr arithmetic — 对指针进行加减运算以遍历内存块的操作,常见于数组处理。
“Ptr arithmetic is often used to iterate through arrays in C.”
(指针算术常用于C语言中的数组遍历。)