Is it on the Stack or Heap?
问题 I have some C code that is something of a puzzle. For a reason to do with this code, I'm wondering how I can tell if a struct object is ending up on the heap or stack? The objects are not being created with malloc or calloc . They start their life in the form of an array. For the purposes of this post, I'm going to call the struct Emp. Emp myEmp[6]; /* Each myEmp[?] item is populated in code */ The objects are sorted and manipulated in various ways and at some point, the objects are copied