に私はArduinoのプロジェクトにCで働いていると私は、次のような状況があります。保存配列は、c
私はサイズの異なる3つのchar配列を持っている、と私はアドレスを格納したいのですがこれらの各々を第4のアレイに入れる。私はそれ以降のコードで、DATA_A、DATA_B、及びDATA_Cを変更したい、とall_dataアレイを有しているだろうので、私は文字列のそれぞれのアドレスことがこれらを必要
は依然として改変配列を指します。
unsigned char data_a[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
unsigned char data_b[3] = {0x08, 0x09, 0x0a};
unsigned char data_c[7] = {0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11};
int all_data_array_length = 3;
unsigned char* all_data[all_data_array_length] = {&data_a, &data_b, &data_c};
...
/*modify the data_a, data_b, data_c arrays */
...
for(int i = 0; i<all_data_array_length; i++) {
/* do something with what all_data[i] points to /*
}
これはにつながる:私は混乱していますどこだと思い
cannot convert 'unsigned char (*)[8]' to 'unsigned char*'
は、char *とのchar []、およびどのようにchar型の配列へのポインタを作成するの区別です。
すべてのご協力ありがとうございます。
アンパサンドを削除してみます。 –