Skip to main content

Command Palette

Search for a command to run...

Reserved Keywords

Updated
2 min read
J

I am Jyotiprakash, a deeply driven computer systems engineer, software developer, teacher, and philosopher. With a decade of professional experience, I have contributed to various cutting-edge software products in network security, mobile apps, and healthcare software at renowned companies like Oracle, Yahoo, and Epic. My academic journey has taken me to prestigious institutions such as the University of Wisconsin-Madison and BITS Pilani in India, where I consistently ranked among the top of my class.

At my core, I am a computer enthusiast with a profound interest in understanding the intricacies of computer programming. My skills are not limited to application programming in Java; I have also delved deeply into computer hardware, learning about various architectures, low-level assembly programming, Linux kernel implementation, and writing device drivers. The contributions of Linus Torvalds, Ken Thompson, and Dennis Ritchie—who revolutionized the computer industry—inspire me. I believe that real contributions to computer science are made by mastering all levels of abstraction and understanding systems inside out.

In addition to my professional pursuits, I am passionate about teaching and sharing knowledge. I have spent two years as a teaching assistant at UW Madison, where I taught complex concepts in operating systems, computer graphics, and data structures to both graduate and undergraduate students. Currently, I am an assistant professor at KIIT, Bhubaneswar, where I continue to teach computer science to undergraduate and graduate students. I am also working on writing a few free books on systems programming, as I believe in freely sharing knowledge to empower others.

The latest specification for the C programming language is the ISO/IEC 9899:2018 standard, commonly referred to as C18. Below is a list of keywords defined in this standard. These keywords are reserved by the language for specific uses and cannot be used for other purposes, like naming variables or functions.

The table is organized into four columns for easier reference:

KeywordKeywordKeywordKeyword
autobreakcasechar
constcontinuedefaultdo
doubleelseenumextern
floatforgotoif
inlineintlongregister
restrictreturnshortsigned
sizeofstaticstructswitch
typedefunionunsignedvoid
volatilewhile_Alignas_Alignof
_Atomic_Bool_Complex_Generic
_Imaginary_NoreturnStaticassertThreadlocal

What Does "Reserved" Mean?

In the context of a programming language, "reserved" means that these keywords have a specific meaning and function within the language's syntax and cannot be used for anything other than their intended purpose. For instance, you cannot name a variable "if" or "while" because these words are reserved for control flow statements in C.

Here's a simple example demonstrating the use of some of these keywords:

#include <stdio.h>

int main() {
    int count;
    for (count = 0; count < 5; count++) {
        printf("Count is: %d\n", count);
    }
    return 0;
}

In this snippet:

  • int is a keyword used to declare an integer variable.

  • for is a keyword used to create a loop.

  • return is a keyword used to return a value from a function.

Using these reserved keywords for other purposes, like naming variables, would result in a syntax error. For instance, int for; would not be valid because for is a reserved keyword.

More from this blog

Jyotiprakash's Blog

251 posts

I'm Jyotiprakash, a software dev and professor at KIIT, with expertise in system programming.