Hallo,
Code (auf einem Atmega16):
Wenn Variable int8_t a mit a=a+1 hochgezählt wird sieht die Ausgabe wie erwartet so aus:Code:int8_t a=0; while(1) { usart_put_int (a); usart_puts("\r\n"); pause(1,10); a=a+1; }wird die Variable a aber mit a++ hochgezähltCode:. . . 120 121 122 123 124 125 126 127 -128 -127 -126 -125 -124 -123 -122 -121 -120 . . .wird sieht es so aus:Code:int8_t a=0; while(1) { usart_put_int (a); usart_puts("\r\n"); pause(1,10); a++; }ich bin verwirrt!Code:. . . 125 126 127 128 129 130 . . . 32765 32766 32767 -32768 -32767 -32766 -32765 . . .![]()
Gruss
M.







Zitieren


Lesezeichen