test
splitData.h@0:44e295c34728, 2019-02-15 (annotated)
- Committer:
- yuto17320508
- Date:
- Fri Feb 15 09:57:11 2019 +0000
- Revision:
- 0:44e295c34728
bit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yuto17320508 | 0:44e295c34728 | 1 | /*intの数をchar型の欲しいbyte数に変換*/ |
yuto17320508 | 0:44e295c34728 | 2 | |
yuto17320508 | 0:44e295c34728 | 3 | #ifndef __INCLEDED_SPRITDATA_H |
yuto17320508 | 0:44e295c34728 | 4 | #define __INCLEDED_SPRITDATA_H |
yuto17320508 | 0:44e295c34728 | 5 | |
yuto17320508 | 0:44e295c34728 | 6 | void Intobyte(int wannaChange,int byte,char *chardata,int firstElement); |
yuto17320508 | 0:44e295c34728 | 7 | //指定されたbyte数のchar型に分解.最初の配列に下八桁が入る。一番左に符号(正だと0,負だと1)。 |
yuto17320508 | 0:44e295c34728 | 8 | |
yuto17320508 | 0:44e295c34728 | 9 | //例 wantChangeという変数の下23桁(3バイト)を、charnum[5]から順に入れたい。 |
yuto17320508 | 0:44e295c34728 | 10 | // →Intobyte(wantChange,3,charnum,5); |
yuto17320508 | 0:44e295c34728 | 11 | //これでcharnum[5]にwantChangeの下八桁,でcharnum[6]に下16桁、charnum[7]に下23桁が入り、charnum[7]の一番左に符号が入る。 |
yuto17320508 | 0:44e295c34728 | 12 | |
yuto17320508 | 0:44e295c34728 | 13 | |
yuto17320508 | 0:44e295c34728 | 14 | #endif |