I want to make a few programs using pascal, but might need to use C for some low level stuff. How can I easily mix C and pascal together? Can I just rewrite what I want to do with C in pascal instead? I might need to interface with some hardware, that's why C might come into the picture.
I want to make a few programs using pascal, but might need to use C for some low level stuff.... I might need to interface with some hardware, that's why C might come into the picture.
Also when linking C and pascal together, you should use the C memory manager from the cmem unit (must be the first unit in the uses clause of your lpr)I see in the documentation of cmem that it must be the first unit (https://wiki.freepascal.org/CMem (https://wiki.freepascal.org/CMem)), and that cthreads should preferably be the very first unit (https://www.freepascal.org/docs-html/rtl/cthreads/index.html (https://www.freepascal.org/docs-html/rtl/cthreads/index.html)) which is all OK, until I get to this page https://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial (https://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial) where the "Units needed for a multi-threaded application" section states:
So both cmem and cthreads need to be the first unit?!
Joking aside, due to how the units work a sensible order is cmem, cthreads and then cwstrings.
Joking aside, due to how the units work a sensible order is cmem, cthreads and then cwstrings.
What about clocale? Does its order matter too?