I'm trying to code a TreeSort function in C89 for practice with a qsort parameters i.e. (void* base, size_t num, size_t size, int (*compare)(const voi ...
I'm trying to code a TreeSort function in C89 for practice with a qsort parameters i.e. (void* base, size_t num, size_t size, int (*compare)(const voi ...
The problem is as follows. I want a function that, given a list and a max number of occurrences "x", deletes all elements of the list that appear more ...
The following code takes an array of integers and create an array with the mobile means (i.e. the value in i-th place is the mean of the last n elemen ...
I'm trying to fill a table with structs inside a for loop, and I can't find anywhere how it's supposed to be done. Here is the code for the struct : ...
I want to show that arrays can't be defined with a variable for the length in C89 or C90. I use GCC on Windows from TDM GCC: My compilation option ...
Are there any ANSI C conforming environments where all-bits-zero is not a representation for a null pointer? That is, environments where the following ...
I'm trying to make a 2D array that can be a varying size based on user input however with the code I have right now whenever the user inputs the size ...
Trying to create a map for a little game. When initialising the map with 2D arrays using malloc, the main function will run okay when the printMap fun ...
I'm trying to program up a 2D dynamically allocated array for a map for a small game. Below is my code, I'm unsure why int* array[yCoord] is throwing ...
My code below is trying to output the next power of 2 when the program is run, so ./powers would return 4, then if I run again, ./powers would return ...
I realize there are lots of "Is this pointer madness defined behavior in C?" questions on this site, but none of the ones I found seemed to be on poin ...
So, im programming in C89, and its going well so far except one issue, Im doing multithreaded applications and I need to use atomic. I dont want to s ...
For code that is compiled on various/unknown architectures/compilers (8/16/32/64-bit) a global mempool array has to be defined: This mempool is use ...
The ANSI X3.159-1989 "Programming Language C" standard states in the chapter "5.2.1.2 - Multibyte characters" that: For the source character set, ...
The ANSI X3.159-1989 "Programming Language C" standard states in the chapter "5.2.1.2 - Multibyte characters" that: For both [source and execution ...
I have a file I'm trying to extract the integers and characters out of. 10 20 0 0 # 1 0 | 2 0 | 3 0 | 3 1 - 3 2 - 3 3 - 3 4 > My current code is ...
I have a text file which consists of about 30000 words. My goal is to count the actual number of the words (keep in mind that multiple punctuation mar ...
The C Programming Language by Brian Kernighan and Dennis Ritchie contains a lot of examples such as this famous one (K&R 2nd edition 1.1): Here ...
This is purely for readability. I want to have a very large constant array of values, but it makes my file a lot less pleasant to read. So I'd like to ...
I'm new to C and learning C90. I'm trying to parse a string into a command, But I have a hard time trying to remove white chars. My goal is to parse ...