📜  c 构造函数 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:40.235000             🧑  作者: Mango

代码示例1
somestruct* somestruct_factory(/* per haps some initializer agrs? */)
{
  malloc some stuff
  fill in some stuff
  return pointer to malloced stuff
}


void somestruct_destructor(somestruct*)
{
  do cleanup stuff and also free pointer
  free(somestruct);
}