Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
calling my custom function same as library function
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Gordon Burditt, post: 2406738"] Do you think it is advisable for me to make a header I think it would be an extremely bad idea to do this for functions that need static or global data which OUGHT TO be shared but won't be. atof() and atoi(), fine, except you will have multiple copies of the code in your executables. malloc(), *NOT FINE*. You didn't include a matching free() in there. Expect all heck to break loose when you try to free() something allocated from a different pool than it was originally malloc()ed from. This is a problem even if you were careful to ensure that every piece of your program that uses malloc() includes your header file. You end up with multiple copies of code, unnecessarily. There are lots of potential problems when each copy of malloc() is using its own pool of memory and someone free()s using a different instance of malloc() than what it was allocated with. Gordon L. Burditt [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
calling my custom function same as library function
Top