Results for “C”
Small, practical examples. Search by task or narrow things down below.
Advance a date by a number of days
Python: Use timedelta so month and year boundaries are handled automatically.
Python✓ Tested
Advance an index around a fixed collection
Arduino / C: Modulo wraps a bounded nonnegative index to zero.
Arduino / C✓ Tested
Align a nested grid with its parent’s columns
CSS: Subgrid reuses the parent tracks for the nested grid’s covered span.
CSS✓ Tested
Align an image within its content box
CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.
CSS✓ Tested
Align inline text in its container
CSS: Learn how to align inline text in its container in a complete browser example.
CSS✓ Tested
Align inline text to the container’s end edge
CSS: Text-align end follows the writing direction rather than always choosing the right edge.
CSS✓ Tested
Allocate a zeroed array
Check calloc, use the allocation, and release it in C.
C✓ Tested
Allocate an independent copy of a C string
C: Include one extra byte for the terminating null character.
C✓ Tested
Allocate and free a typed array
C: Use sizeof on the pointed-to type and check allocation success before writing.
C✓ Tested
Allocate and initialize a structure
C: Use a compound literal assignment to initialize all ordinary structure fields.
C✓ Tested
Allow a long flex child to shrink inside its container
CSS: Min-width zero removes the default content-size floor so local overflow handling can take effect.
CSS✓ Tested
Allow embedded scripts without granting same-origin access
HTML: Grant only allow-scripts so the sandboxed document retains an opaque origin.
HTML✓ Tested