Posts

Showing posts from September, 2024

curl/curl.h file not found in FreeBSD

When I use clang to compile test.c, the following error occurs. fatal error : 'curl/curl.h' file not found The compile command is: $ clang test.c -o test I did some research. Then I know I need to change the compile command as follows: $ clang -I/usr/local/include -L/usr/local/lib -lcurl test.c -o test

fopen vs open in C

1. fopen is defined in the C standard library , but open is not. Therefore fopen is more portable than open. 2. fopen provides you with buffering IO that may turn out to be a lot faster than what you're doing with open.