I have been learning C for a couple weeks now (off and on). My primary use will be data analysis. I am surprised to find that simple functions are not available in the standard math.h library (e.g. average, mode, variance, etc.). Granted, these functions are simple enough to write, but doing so EVERY time they are needed is cumbersome.
I could write my own header file (call it my_math.h) to store all of the non-standard functions, and include this file as needed. I have two questions:
If I create a header file, how do I point my compiler to it? Obviously, I would not want to have to copy the .h file to each project's directory.
Am I reinventing the wheel here? Is there a standard library that has all of these functions pre-built?
Copyright Notice:Content Author:「tnknepp」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/44457019/create-own-library-of-c-functions