' P '

whatever I will forget

Entries from 2020-01-08 to 1 day

C const char* のサイズ取得

C

#define SAMPLE (const char*)"AAAAA"; このSAMPLEのサイズを取得したい場合 もちろんsizeof(SAMPLE)とすると4バイトしか取れません。(ポインタなので) strlen((char*)SAMPLE); とする。 また、SAMPLEの値をchar arrayにセットしたい場合も char sample_ch…