Will Perone

Here is a list of some of the lesser known/lesser used or obscure C functions.

_splitpath Splits a path string into components
_makepath Creates a path string from components
_fullpath Creates a full path string from a relative path string
_getcwd Gets your current working directory (the path where your exe is running from)
_chdir/_mkdir/_rmdir Directory control functions
remove/_unlink Deletes a file
rename Renames a file
_fsopen/_sopen Opens a file with sharing permissions essentially allowing you to read or write lock files.
_searchenv Searches for a file given an 'environment' (a list of paths)
atexit Registers a function to be called upon exiting your program (you can register as many functions as you like, this is great for having your singletons/interfaces automatically self destruct upon program exit)
frexp/ldexp Converts back and forth from IEEE floating point number and its exponent and mantissa
_msize Gets the size of memory of a dynamically allocated object (this is one way to determine the size of a dynamic array that is passed into your function without having to pass in the actual size of the array)
_emit Actually a pseudoinstruction, allows you to put raw exe bytes into your code. I actually had to use this back in the DOS days to do 32 bit instructions in RealMode because the compiler didn't recognize 32bit asm.
__declspec(novtable) MS specific extension. Allows you to declare a class that has no vtable thus reducing codesize. This is great for interface classes. See my Uber Singleton for an example.
No Comments yet, be the first!
<- for private contact