{
  "id": "enwiki-001373899342",
  "slug": "nop-code",
  "title": "NOP (code)",
  "qid": "",
  "lead": "In computer science, a NOP, no-op, or NOOP (pronounced \"no op\"; short for no operation) is a machine language instruction and its assembly language mnemonic, programming language statement, or computer protocol command that does nothing.",
  "body": "In computer science, a NOP, no-op, or NOOP (pronounced \"no op\"; short for no operation) is a machine language instruction and its assembly language mnemonic, programming language statement, or computer protocol command that does nothing. while (getchar() != '\\n') {} alternatively, while (getchar() != '\\n') ; or more tersely: while (getchar() != '\\n'); The last form might generate a warning with some compilers or compiler options, as a semicolon placed after a parenthesis at the end of a line usually indicates the end of a function call expression. The above code continues calling the function getchar() until it returns a \\n (newline) character, essentially fast-forwarding the current reading location of standard input to the beginning of next line. As well as a NOP statement, C programs will also sometimes use a NOP expression; for instance, the C standard requires that, should the NDEBUG macro be defined before the &lt;assert.h&gt; header, the assert() macro defined by it be defined as the expression ((void)0) . Similar techniques can be used by user code; for instance, consider the following code that defines a macro over the prefetch builtin function provided by GCC which is defined as a NOP expression if it's not available: ifdef __GNUC__ define prefetch(addr, ...) __builtin_prefetch((addr) __VA_OPT__ (,) __VA_ARGS__) else define prefetch(addr, ...) ((void)0) endif const noop = () => {};",
  "categories": [
    "125876068",
    "130285717",
    "23118434",
    "23603337",
    "24745113",
    "25557078",
    "32300770",
    "55471075"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1373899342",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1788878082.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001373899342",
    "type": "webpage",
    "title": "NOP (code)",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/nop-code",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          19
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          19
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001373899342",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1373899342",
    "note": "Immutable snapshot enwiki-001373899342"
  }
}