in reply to Perl memset equivalent?

C has no "smart" or particularly "clever" data structures; nothing like a hash or what Perl refers-to as an array. When you look at an existing C program, study what it does ... not how it does it. The choices that a programmer must make when using one language are partly dependent on the task and mostly dependent on the language. The only things that should carry-forward in a reimplementation project are the tasks to be performed, not how it is being done by the program that is being replaced.