C standard library (redirect from Stdlib.h)
ratified in 1995. Six more header files (complex.h, fenv.h, inttypes.h, stdbool.h, stdint.h, and tgmath.h) were added with C99, a revision to the C Standard...
37 KB (3,694 words) - 11:18, 26 January 2025
Berkeley sockets (redirect from Socket.h)
<sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include...
29 KB (3,512 words) - 08:53, 28 April 2025
allocates memory, but doesn't free the memory before exiting. #include <stdlib.h> int main(void) { int * a; a = malloc(sizeof(int)); /* allocate memory...
6 KB (709 words) - 04:20, 27 February 2025
the macro will print a message to stderr and call abort(), defined in stdlib.h. The message includes the source filename and the source line number from...
7 KB (779 words) - 21:51, 9 June 2023
_FRUIT_INCLUDED_ */ fruit.c: #include <string.h> #include <stdlib.h> #include <stddef.h> #include <stdio.h> #include "fruit.h" static struct fruit *fruit_list; static...
26 KB (2,812 words) - 20:26, 18 January 2025
the following source-code written in C: #include <stdio.h> #include <stdlib.h> #include <string.h> size_t foo_len(const char *s) { return strlen(s); } int...
18 KB (1,722 words) - 07:47, 7 June 2025
variables which may contain a copy of the pointer. #include <assert.h> #include <stdlib.h> /* Alternative version for 'free()' */ static void safefree(void...
15 KB (1,891 words) - 06:59, 11 June 2025
C dynamic memory allocation (redirect from Alloc.h)
function ends. The C dynamic memory allocation functions are defined in stdlib.h header (cstdlib header in C++). malloc() takes a single argument (the amount...
36 KB (4,140 words) - 10:03, 27 May 2025
of C code shows how to sort a list of integers using qsort. #include <stdlib.h> /* Comparison function. Receives two generic (void) pointers to the items...
7 KB (831 words) - 01:08, 27 January 2025
<sys/types.h> #include <sys/mman.h> #include <err.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> /* This...
10 KB (1,155 words) - 08:10, 14 May 2025
#include <stdio.h> /* for printf */ #include <stdlib.h> /* for exit */ #include <getopt.h> /* for getopt_long; POSIX standard getopt is in unistd.h */ int main...
21 KB (2,408 words) - 22:05, 22 April 2024
to pass a pointer to that pointer: its address. #include <stdio.h> #include <stdlib.h> void allocate_array(int ** const a_p, const int A) { /* allocate...
85 KB (10,850 words) - 17:42, 6 June 2025
the strtol() function (which converts strings to long integers) in the <stdlib.h> library. Many other programming languages, such as Python, Perl, Ruby...
10 KB (1,231 words) - 17:16, 29 April 2025
C localization functions (redirect from Locale.h)
value) to work around these problems. #include <stdio.h> #include <stdlib.h> #include <locale.h> int main(void) { /* Locale is set to "C" before this...
4 KB (364 words) - 08:28, 7 November 2023
"PRBS-7" sequence can be expressed in C as #include <stdio.h> #include <stdint.h> #include <stdlib.h> int main(int argc, char* argv[]) { uint8_t start = 0x02;...
8 KB (1,064 words) - 16:26, 5 February 2024
shuffle(deck) An implementation in C: #include <stdio.h> #include <stdlib.h> #include <time.h> // executes in-place bogo sort on a given array static...
15 KB (1,891 words) - 00:54, 9 June 2025
the "else" block under "try". #include <setjmp.h> #include <stdio.h> #include <stdlib.h> #include <string.h> static void first(); static void second(); /*...
15 KB (1,784 words) - 01:57, 17 April 2025
the value of i: #include <pthread.h> #include <stdatomic.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> /* i is global, so it is visible...
7 KB (842 words) - 07:15, 10 June 2025
written in the C programming language with AT&T assembly syntax. #include <stdlib.h> int main(int argc, char **argv) { int *iptr; char *cptr; #if defined(__GNUC__)...
8 KB (1,037 words) - 17:10, 26 January 2025
valid memory region to another, as in the following example: #include <stdlib.h> int main() { char *p = malloc(1024); /* first dynamically-allocated block...
4 KB (344 words) - 20:38, 30 March 2023
functions in <string.h> to allocate a copy of a string – similar to POSIX and SVID C extensions. Add memalignment() function in <stdlib.h> to determine the...
39 KB (3,264 words) - 12:28, 4 June 2025
In the C and C++ programming languages, unistd.h is the name of the header file that provides access to the POSIX operating system API. It is defined...
13 KB (302 words) - 16:27, 5 February 2025
standard output. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/uio.h> int main(int argc, char *argv[])...
5 KB (638 words) - 17:36, 14 March 2025
C date and time functions (redirect from Tiem.h)
current time to the standard output stream. #include <time.h> #include <stdlib.h> #include <stdio.h> int main(void) { time_t current_time; char* c_time_string;...
6 KB (349 words) - 16:39, 8 April 2025
Compiler. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/wait.h> #include <signal.h> #define NUMCHLDS 10 void...
6 KB (732 words) - 14:04, 30 July 2024
#include <stdlib.h> int main(void) { exit(EXIT_SUCCESS); /* or return EXIT_SUCCESS */ }...
10 KB (1,034 words) - 12:14, 24 May 2025
Stat (system call) (redirect from Sys/stat.h)
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/types.h> #include <pwd.h> #include <grp.h> #include <sys/stat.h> int main(int argc...
16 KB (983 words) - 10:42, 12 May 2025
flag to the compiler: #include <stdlib.h> #include <stdio.h> #include <readline/readline.h> #include <readline/history.h> int main() { // Configure readline...
16 KB (1,745 words) - 11:50, 30 April 2025
(program1 and program2) using Unix pipes: #include <stdio.h> #include <stdlib.h> #include <unistd.h> /* function prototypes */ void die(const char*); int...
4 KB (547 words) - 13:09, 7 September 2023