Answers for "constructor in c language"

C
1

c constructor

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);
}
Posted by: Guest on March-14-2020

Code answers related to "C"

Browse Popular Code Answers by Language