stack growth direction

后端 未结 5 1580
慢半拍i
慢半拍i 2020-12-06 07:20

So from my previous memmove question I would like to know how to find direction of stack growth.

  void stackDirection(int* i)
  {

     int j;

     if(&         


        
5条回答
  •  旧时难觅i
    2020-12-06 08:11

    This is outside the scope of the C++ standard. It an implementation defined behavior and probably depends on the specific OS/processor architecture etc.

    It is best not to rely or depend on such details, unless you are into ETHICAL hacking :) and / or not so much concerned with portability

提交回复
热议问题