' P '

whatever I will forget

C const char* のサイズ取得

#define SAMPLE (const char*)"AAAAA";

このSAMPLEのサイズを取得したい場合
もちろんsizeof(SAMPLE)とすると4バイトしか取れません。(ポインタなので)

strlen((char*)SAMPLE);

とする。

また、SAMPLEの値をchar arrayにセットしたい場合も

char sample_char[strlen(SAMPLE)];
memcpy(sample_char, (char*)SAMPLE, strlen(SAMPLE));

としておけば動的っぽいです。
(上、なんか怪しいのでとりあえず取り消し線にしてます。下記は動くと思います)

本来は#defineでLENも確保しておくとみやすいです。

#define SAMPLE     (const char*)"AAAAA";
#define SAMPLE_LEN strlen((char*)SAMPLE);

char sample_char[SAMPLE_LEN];
memcpy(sample_char, (char*)SAMPLE, SAMPLE_LEN);