what does ++operator do in this void uart_puts(unsigned char

what does ++operator do in this void uart_puts(unsigned char * t) { while(*t) uart_putch(*t++);

本文关键字:puts unsigned char uart void ++operator does do in this what      更新时间:2023-10-16

++算子在这个C程序中做什么?

void uart_puts(unsigned char *t) {
    while (*t)
        uart_putch(*t++); //I cant understand the operation here
}

指针算术:

句子uart_putch(*t++)可以分解为:

uart_putch(*t);  // get actual t unsigned char value
t++; // increments t pointer to next unsigned char

*t //包含它所指向的变量的地址 *t++ //递增到下一个位置

如:-

int j;
int *k;
k=&j; //assigning k to j's address, so that k pointing the value of j
*k++;//means incrementing the adress to point next

相关文章: