c语言指针排序算法
If you want to have complete knowledge of pointers, pointer arithmetic is very important to understand. In this topic we will study how the memory addresses change when you increment a pointer.
如果您想完全了解指针,那么了解指针算法非常重要。 在本主题中,我们将研究当增加指针时内存地址如何变化。
16位计算机(Turbo C) (16 bit Machine (Turbo C))
In a 16 bit machine, size of all types of pointer, be it int*
, float*
, char*
or double*
is always 2 bytes. But when we perform any arithmetic function like increment on a pointer, changes occur as per the size of their primitive data type.
在16位计算机中,所有类型的指针( int*
, float*
, char*
或double*
大小始终为2个字节 。 但是,当我们执行任何算术函数(例如,对指针进行增量)时,会根据其原始数据类型的大小发生更改。
Size of datatypes on 16-bit Machine:
16位计算机上数据类型的大小:
Type | Size (in bytes) |
---|---|
int or signed int | 2 |
char | 1 |
long | 4 |
float | 4 |
double | 8 |
long double | 10 |