C dynamic array allocation and strange use of memset

后端 未结 0 705
栀梦
栀梦 2021-01-16 08:19

I recently ran into this code in C:

int m=5;
int n=4;
int *realfoo = new int[m+n+3];
int *foo;
foo = realfoo + n + 1;
memset(realfoo, -1, (m+n+2)*sizeof(int))         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题