C
Learn C by typing real, low-level code.
Type your way through C's fundamentals: pointers and pointer arithmetic, manual malloc/free memory management, structs, arrays, and string handling with char buffers. Every snippet is real C, and an AI tutor explains each line — where a pointer actually points, why a buffer needs its null terminator — so the low-level model becomes concrete as you build speed.
Progress0 / 697 solved · 0/50 sections
best wpm
0
avg wpm
0
accuracy
0%
runs
0
level
1
rating
1000
Run C on your machine
1. Install the toolchain
brew install gcc # or: sudo apt install build-essential2. Save your code as hello.c, then compile & run
gcc hello.c -o hello && ./helloprogress by section
1Fundamentals0/16start →
2Strings In Depth0/18start →
3Values & References0/18start →
Address and dereferencePointer arithmeticArrays decay to pointersPass by pointer mutatesPass by value copiesPointer to constNull pointer as absenceStruct through a pointerSwap via pointersBorrow a big structconst pointer vs pointer to constAvoid dangling pointersHeap ownershipReturn a pointer into dataTwo-pointer reversePointer to pointerFunction pointersvoid pointer
4Slices & Arrays0/18Unlock →
5Data structures0/11Unlock →
6Iterators0/20Unlock →
sum / product / countchain two arraysindex with each itemfilter via callbackmap via callbackstep and reversetake and skipfilter and map in one passfold with a callbackmin and max by keypartition into tworeduce without a seedany / all / find / positiontake_while and skip_whilezip parallel arraysflatten and expandbuild a lookup tablepeek at the next itemscan (running results)collect or fail
7Traits0/20Unlock →
Default valuesOperator: addShallow vs deep copyConversion functionEquality functionHash functionAccept a common typeOperator: negateComparator & qsortOperator: add-assignCustom formatterCleanup (RAII-like)Operator: scaleFallible conversionWrapper accessOperator: indexInterface as a vtableExpose an iteratorCustom iteratorFold into an aggregate
8Generics0/20Unlock →
Compile-time array lengthType-generic max macroType-generic min macroqsort by sizeEither of two typesA void* containerbsearch by size_Generic dispatchType-generic clampGeneric print macroType name via _GenericA newtype wrapperqsort structs by keySwap with typeofA generic stackSize as a constantGeneric for-eachMap over raw elementsGenerate a typed vectorHand-written generic sort
9Lifetimes0/20Unlock →
A slice into the inputCapture by handFunction pointers hold no borrowsReturn a borrowed inputReturn a field pointerStatic storage durationReturn an array elementMethods on a borrowing structA struct that borrowsFree once, then null outA borrow in a unionTwo borrowed fieldsAvoid a dangling pointerBorrow any typeCleanup with gotoLongest in an arrayA borrowed mutable bufferOwnership transferA borrowing parserA borrowing cursor
10Closures0/20Unlock →
A named helperCapture with a context structExplicit types and bodyMultiple parametersCallbacksA predicate with contextFunction pointer as argumentFunction pointersFunctions drive a pipelineOwning captured dataqsort with a comparatorA stateful counterCurrying with a structMutating through a pointerConsume onceBy reference vs by valueReturn a function pointerAn array of function pointersCompose two functionsReturn one of several functions
11Pattern Matching0/20Unlock →
switch on literalsHandle one case, else fall backBranch yields a valueAn optional valueFallthrough labelsRanges via an if-chainA result valueDestructure a structMatch a point's shapePositional fieldsLoop while it matchesTest and keep the valueExtra conditionsMatch through a pointerBind the endsTagged union + switchMatch a collection's sizeBind or bail outMatch by lengthRecurse over a tree
12Error Handling0/20Unlock →
Return-code statusassert invariantserrno and perrorFall back to a defaultOut-parameter result-1 sentinelNULL sentinelstrerrorValidate inputsEnum error codesCompute a fallbackKeep only successesError message tableStatus-plus-value structAdd context to an errorStop at first failuregoto cleanupPropagate error codesstrtol with checkssetjmp / longjmp
13Option & Result0/20Unlock →
Check before useNULL for absenceOut-param plus boolSentinel valueValue or defaultFilter an OptionMap with a defaultFall back to anotherPresent and passesReduce result to a boolTagged Option structChain fallible stepsFirst token or defaultFlatten nested absenceMap an OptionReplace the valueResult-like structTake the value outZip two OptionsAll present or none
14Conversions0/15Unlock →
15Collection Conversions0/19Unlock →
Clone an arrayLength of a linked listConcatenate two arraysSet membership testCharacter frequency tableDedup into a setFlatten a 2D arrayInvert key/value pairsLinked list to arrayParallel arrays as a mapReshape 1D into 2DTranspose a matrixZip two arrays to pairsArray to linked listUnique, keeping orderBuild a frequency tableBuild a list by prependingSort then dedupArray to hash table
16Math0/14Unlock →
17Encoding0/23Unlock →
Bytes to stringChar to code pointString to bytesASCII checks and caseChange case in placeList code pointsChar digit valueOctal and hex formattingBig-endian bytesBinary representationHex encodeLittle-endian bytesParse a number in a baseCaesar cipherDetect endiannessHex decodePercent-encodeROT13XOR cipherHex dumpPercent-decodeBase64 decodeBase64 encode
18Random0/20Unlock →
Seed from the clockRange with moduloCoin flipRoll a diePick a random elementRandom bytesWeighted true/falseRandom enum valueLinear congruential generatorPassword generatorRange without biasReproducible sequencesRandom alphanumeric stringAn xorshift generatorRoll many diceSample k without replacementFisher-Yates shuffleRandom double in [0, 1)Weighted choiceNormal distribution
19Data I/O0/18Unlock →
Parse CSV into rowsTab-separated valuesBuild a CSV stringSelect one columnCSV into a number matrixSplit off the headerWhitespace-separated matrixRead a data fileSerialize records to CSVSkip blanks and commentsPrint an aligned tableWrite CSV to a fileWrite a matrix as textAppend a rowParse key=value configRound-trip write then readStream lines with fgetsDrop unparseable rows
20Linear Algebra0/21Unlock →
Matrix shapeDot productScalar multiplyA matrix of zerosElementwise addArgmax of a vectorIdentity matrixOne-hot encodeTraceReLU and sigmoidApply a function elementwiseColumn meansColumn sumsCosine similarityFlatten to 1DMatrix times vectorTransposeMatrix multiplyMin-max normalize columnsSoftmaxStandardize columns (z-score)
21Text Processing0/16Unlock →
22Date & Time0/13Unlock →
23Memory0/12Unlock →
24Modules0/20Unlock →
Angle brackets vs quotesInternal linkage with staticNamespaced constantsNamespaced enumExternal linkageHeader include guardNamespacing with prefixesFile-scope static stateDeclaration vs definitionA header as an APIPrivate helperstatic inline helpersA struct plus its functionsTranslation unitsPrefixed typedefextern const across filesForward declarationOpaque typesSeparate compilationA module interface
25Macros0/20Unlock →
An object-like macroassert()A function-like macro#ifdef and #ifndefMAX and MIN macros#pragma onceAn ARRAY_LEN macroAn include guard#if / #elif with an expression__LINE__ and __FILE__Standard predefined macrosstatic_assertStringify with ##undef and redefineMulti-line do/while(0) macroToken paste with ##Variadic macro__VA_OPT__ for zero args_Generic type dispatchX-macros
26Testing0/20Unlock →
assert() from assert.hA truth tableAsserting inequalityComparing arraysA tiny CHECK macroDocumenting and testingTesting an error codeA shared test helperMultiple test functionsTesting for NULLReporting via the exit codeCompile-time testsTesting string outputTesting struct behaviorCounting passes and failsAn EXPECT_EQ macroAn expected failureComparing floatsTesting across a rangeTable-driven tests
27Algorithms0/8Unlock →
28Sorting Algorithms0/12Unlock →
29Expression Parsing0/6Unlock →
30Idioms0/9Unlock →
31OOP & Traits0/8Unlock →
32Trait Objects0/14Unlock →
Default method over an objectTake a trait objectReturn one of several typesAn array of trait objectsStore behaviors togetherOne type vs manyShared ownershipA slice of trait objectsStatic vs dynamic dispatchExtending an objectAn object that borrows dataRecover the concrete typeA handler registrySelf-taking methods
33Design Patterns0/14Unlock →
35File I/O0/6Unlock →
36Filesystem0/18Unlock →
Does a path exist?Copy a fileFiles vs directoriesBuild a pathCreate a directoryList a directoryRename or movebasename and dirnameFile extensionIs it a directory?File metadataRemove files and dirsStrip the extensionWrite to the temp dirLast modified timeSorted listingTotal size of a treeWalk the tree
37Networking0/16Unlock →
38Concurrency0/7Unlock →
39Unsafe & FFI0/14Unlock →
40Commands0/14Unlock →
41Array0/10Unlock →
43String0/10Unlock →
45Interval0/5Unlock →
46Linked List0/6Unlock →
47Tree0/14Unlock →
Maximum Depth of Binary TreeInvert Binary TreeSame TreeLowest Common Ancestor of a BSTBinary Tree Level Order TraversalSubtree of Another TreeImplement Trie (Prefix Tree)Kth Smallest Element in a BSTValidate Binary Search TreeAdd and Search WordConstruct Binary Tree from Preorder and InorderBinary Tree Maximum Path SumSerialize and Deserialize Binary TreeWord Search II