Essential storage keeps sign-in and learning features working. Google Analytics measures visits; Microsoft Clarity records interactions to help us improve usability. Both are optional and stay off until you choose. Read our privacy policy.
Repeat work while a condition remains true, change state each pass, and keep an obvious exit.
Return the number of English vowels in a null-terminated string. Count upper- and lower-case letters, and treat a null pointer as an empty string.
Learn C syntax, variables, data types, operators, conditions, loops, functions, arrays, strings, pointers, structures, dynamic memory, files, and a project.
Browse HTML, CSS, JavaScript, Python, C, C++, SQL and Git tutorials.
Write copy_string that copies source into destination when capacity is non-zero, always terminates the destination, and reports failure if the source will not fit.
Remove duplicates in-place from an ascending integer array and return the number of unique values. The retained prefix must preserve ascending order.
Implement append_int so a heap-backed buffer grows geometrically, checks multiplication overflow, and leaves the original allocation untouched if realloc fails.
Parse a simple inventory record in the form id,name,quantity into a struct. Reject missing fields, extra commas, an empty name, and a quantity outside 0..100000.
Implement parse_quantity using strtol. Accept only a complete base-10 integer in range 0..100000, reject whitespace-only or trailing characters, and report success through the return value.
Given app.c, inventory.c, inventory.h, and Makefile, explain and write the dependency rules needed so changing inventory.h recompiles both relevant object files before linking.
Implement find_max to write the greatest array value into out. Return 1 on success and 0 when the array is empty, the pointer is null, or out is null.
Implement queue_push for a fixed-capacity circular queue. Return 0 when the queue is full or invalid; otherwise store the value, advance tail with wraparound, and increase size.
Implement sum_array so it returns the sum of exactly length elements. The caller owns the array; handle a null pointer or zero length without dereferencing it.
Implement swap_ints so the caller's two integer variables exchange values. It must do nothing when either pointer is null.