LoginSignup
0
1

More than 5 years have passed since last update.

coding79 > ポインタを書替える > #if 1 char szbuf[100]; dstPtr = &szbuf[0];

Last updated at Posted at 2016-12-12

内容

たった今、思いついた。

static void s_TRT_setFloatToCharArray(char *dstPtr)
{
        ...
}

上記のコードがあった時、dstPtrにchar文字列を代入しても関数内のデバッグではその配列を見ることができない。

以下のように一時的に変更する

static void s_TRT_setFloatToCharArray(char *dstPtr)
{
#if 1
    char szbuf[100];
    dstPtr = &szbuf[0];
#endif
        ...
}

ステップ実行時にszbuf[]を見ることでどういう代入になっているかわかる。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1