CAN (Cancel) is ASCII code point 24 (0x18), Unicode U+0018. It is a C0 control character that signaled a teleprinter to discard the current line or transmission in progress. In ANSI/VT terminals, Ctrl+X emits 0x18 and aborts an in-progress escape sequence, returning the parser to ground state — useful when a corrupted byte stream leaves the terminal mid-sequence. XMODEM uses CAN as an explicit transfer-abort signal: sending two consecutive 0x18 bytes tells the remote side to abandon the file transfer entirely. UTF-8 encodes it as the single byte 0x18; Unicode classifies it as Cc (Control) with the alias CANCEL.
unsigned char CAN = 0x18;unsigned char buf[] = { 'A','B', CAN,'C' };// Cancel triggers a parser reset in many state machinesif (memchr(buf, CAN, sizeof buf)) parser_reset();
CAN (ASCII 24) tells the receiver to discard the current data transmission. Think of it as the 'never mind' signal — the sender is saying the data it just sent is garbage and should be thrown away.
No, they're different. CAN (Ctrl+X in some systems) is ASCII 24 and signals data cancellation in protocols. Ctrl+C generates ASCII 3 (ETX) and is used by Unix terminals to send SIGINT, which interrupts a running process.
Mostly in legacy serial protocols and embedded systems where devices exchange raw byte streams. If a transmission error is detected mid-stream, CAN tells the other end to drop the partial data and wait for a fresh start.
Very rarely as the actual byte. The concept lives on in protocol design though — HTTP request cancellation, gRPC stream resets, and WebSocket close frames all serve the same purpose with more sophisticated mechanisms.