Karnataka KSEAB SSLC JTS Programming in ANSI C key terms
Karnataka KSEAB SSLC JTS Programming in ANSI C · Get comfortable with the vocabulary.
- token
- Related: identifier, keyword, preprocessor directive
The smallest individual unit of a C program that the compiler recognises, such as a keyword, identifier, constant, string literal, operator, or punctuation mark. The compiler scans source text and splits it into tokens before parsing.
- identifier
- Related: keyword, variable, scope
A programmer-chosen name for a variable, function, or other entity, formed from letters, digits, and the underscore, never starting with a digit, and not matching any keyword. Identifiers are case-sensitive in C.
- keyword
- Related: identifier, data type
A word reserved by the C language with a fixed meaning, such as int, if, while, return, or struct. Keywords cannot be reused as identifiers and are written in lowercase.
- data type
- Related: variable, declaration, type conversion
A specification of what kind of values a variable can hold and how much storage it needs, for example int, float, char, or double. It also determines which operations are valid on the value.
- declaration
- Related: variable, function prototype, storage class
A statement that introduces a name and its type to the compiler before use, optionally with an initial value. A definition also reserves storage, whereas a declaration alone may only announce an existing entity.
- constant
- Related: variable, preprocessor directive, enumerated type
A value fixed at compile time that cannot be changed during execution, written as a literal such as 25, 3.14, 'A', or "hello". Named constants are often created with const or #define.
- variable
- Related: declaration, storage class, scope
A named storage location whose value can change while the program runs. Each variable has a type, a name, a memory address, and a lifetime determined by where it is declared.
- type conversion
- Related: data type, operator precedence, integer division
Changing a value from one data type to another, either implicitly by the compiler when types are mixed in an expression, or explicitly by the programmer with a cast such as (float) n. Narrowing conversions may lose data.
- operator precedence
- Related: associativity, type conversion, relational operator
The fixed ranking that decides which operator in an expression is applied first, for example multiplication before addition. Parentheses override the default order and are recommended for clarity.
- associativity
- Related: operator precedence, assignment operator
The rule that fixes the evaluation direction when two operators share the same precedence level, such as left-to-right for subtraction or right-to-left for assignment. It resolves expressions like a - b - c or x = y = 0.
- modulus operator
- Related: integer division, arithmetic operator
The binary % operator that yields the remainder after integer division, so 17 % 5 gives 2. It applies only to integer operands, and the sign of the result follows the dividend in C.
- relational operator
- Related: logical operator, operator precedence
An operator that compares two values and produces 1 for true or 0 for false, namely <, <=, >, and >=. Equality checks use the separate == and != operators and are often confused with assignment.
- logical operator
- Related: relational operator, bitwise operator, short-circuit evaluation
One of &&, ||, and !, used to combine or negate conditions. They treat any nonzero value as true, return 1 or 0, and short-circuit so the right operand may not be evaluated.
- bitwise operator
- Related: logical operator, masking, type conversion
An operator that works on the individual bits of integer operands: &, |, ^, ~, <<, and >>. These differ from logical operators because they do not short-circuit and act on every bit position.
- increment operator
- Related: decrement operator, side effect, assignment operator
The unary ++ operator that adds one to its operand. In prefix form (++n) the value is increased before use; in postfix form (n++) the old value is used in the expression and then increased.
- assignment operator
- Related: increment operator, relational operator, operator precedence
The = operator that stores the right-hand value into the left-hand variable, plus compound forms such as +=, -=, *=, and /= that combine an arithmetic operation with assignment. It is not a comparison.
- switch statement
- Related: break statement, default label, if-else statement
A multi-way selection statement that compares one integer or character expression against constant case labels and jumps to the matching one. Execution falls through to later cases unless break is used.
- break statement
- Related: continue statement, switch statement, loop
A jump statement that immediately exits the innermost enclosing loop or switch. Inside a switch it prevents fall-through into the following cases.
- continue statement
- Related: break statement, loop, goto statement
A jump statement that skips the remaining statements of the current loop iteration and begins the next one. In a for loop the update expression still executes before the next test.
- loop
- Related: continue statement, break statement, sentinel value
A control structure that repeats a block of statements: for is used when the count is known, while tests before each iteration, and do-while tests after, guaranteeing at least one execution.
- goto statement
- Related: continue statement, loop, flowchart
An unconditional jump to a labelled statement inside the same function. It is discouraged in structured programming because it obscures control flow, though it is sometimes used to exit deeply nested loops.
- function prototype
- Related: function definition, parameter, return value
A declaration that tells the compiler a function's name, return type, and parameter types before the function is defined or called. It lets the compiler check argument counts and types.
- parameter
- Related: function prototype, pass by value, pass by reference
A variable listed in a function's definition that receives a copy of the value supplied by the caller, called an argument. In C, parameters are passed by value unless a pointer is used.
- return value
- Related: function prototype, recursion, storage class
The single value a function sends back to its caller through the return statement, whose type must match the declared return type. A function returning void sends nothing back.
- recursion
- Related: return value, stack frame, scope
A technique in which a function calls itself with a smaller or simpler input, requiring a base case that stops the chain. Each pending call keeps its own copy of local variables on the stack.
- scope
- Related: storage class, variable, identifier
The region of a program in which a declared name is visible and can be used. Block scope covers a compound statement, function scope covers a whole function, and file scope covers the whole source file.
- storage class
- Related: scope, declaration, variable
A specifier such as auto, register, static, or extern that controls a variable's lifetime, visibility, and initial value. static keeps a local variable alive across calls; extern refers to an object defined elsewhere.
- array
- Related: two-dimensional array, string, pointer arithmetic
A collection of a fixed number of elements of the same type stored in consecutive memory locations and accessed by an index starting at 0. The array name usually decays to a pointer to its first element.
- string
- Related: array, string handling function, pointer
A sequence of characters stored in a char array and terminated by the null character '\0'. Standard functions such as strlen and strcpy rely on that terminator to find the end of the string.
- string handling function
- Related: string, header file, array
A library routine declared in string.h that operates on null-terminated strings, for example strlen, strcpy, strcat, strcmp, and strstr. Include the header before calling them.
- pointer
- Related: pointer arithmetic, address-of operator, dynamic memory allocation
A variable that stores the memory address of another object. Pointers must be declared with the type they point to, and the * operator dereferences them to reach the stored value.
- pointer arithmetic
- Related: pointer, array, pass by reference
Arithmetic performed on pointers, where adding 1 advances by the size of the pointed-to type rather than one byte. Subtracting two pointers in the same array yields the number of elements between them.
- pass by reference
- Related: pass by value, pointer, parameter
A calling style in C simulated by passing a pointer, so the function can modify the caller's variable through dereferencing. C itself passes all arguments by value, including pointer values.
- dynamic memory allocation
- Related: pointer, memory leak, structure
Reserving memory at run time from the heap with malloc, calloc, or realloc, and releasing it with free. The programmer, not the compiler, is responsible for freeing it to avoid leaks.
- structure
- Related: union, typedef, enumerated type
A user-defined type that groups named members, possibly of different types, under one name. Members are accessed with the dot operator, or with -> through a pointer to a structure.
- union
- Related: structure, typedef
A user-defined type whose members share the same memory area, so only one member holds a valid value at a time. Its size equals the size of its largest member.
- enumerated type
- Related: typedef, constant, structure
A user-defined type declared with enum that gives names to a set of integer constants, improving readability. The first name is 0 by default and each later name increases by one.
- typedef
- Related: structure, union, enumerated type
A keyword that creates a new name, an alias, for an existing type without creating a new type. It is commonly used to shorten structure declarations and to name pointer types clearly.
- format specifier
- Related: printf function, scanf function, file pointer
The conversion code in a printf or scanf format string, such as %d for int, %f for float, %c for char, and %s for string. Type and specifier must match or the output or input is wrong.
- file pointer
- Related: fopen function, format specifier, end-of-file
A value of type FILE * returned by fopen that identifies an open stream and its position. It is passed to functions such as fgetc, fputs, and fclose, and NULL signals a failed open.
- preprocessor directive
- Related: header file, macro, constant
A line beginning with # that is handled before compilation, such as #include, #define, and #ifdef. These lines are not C statements and do not end with a semicolon.
- macro
- Related: preprocessor directive, header file, operator precedence
A name created with #define that the preprocessor replaces textually before compilation. Because substitution is textual, macros should parenthesise their parameters to avoid precedence errors.
- header file
- Related: preprocessor directive, string handling function, function prototype
A file with a .h extension included with #include that supplies declarations for library or user functions, such as stdio.h and string.h. Including it lets the compiler check calls.
- algorithm
- Related: flowchart, pseudocode, debugging
A finite, ordered set of unambiguous steps that solves a problem and produces a result. It is written before coding and may be expressed in pseudocode or as a flowchart.
- flowchart
- Related: algorithm, pseudocode, loop
A diagram of an algorithm using standard symbols: an oval for start and stop, a parallelogram for input or output, a rectangle for a process, and a diamond for a decision. Arrows show the order of execution.
- debugging
- Related: algorithm, compilation, flowchart
The process of locating and correcting errors in a program, whether syntax errors reported by the compiler, run-time errors such as division by zero, or logic errors that give wrong but valid results.
- compilation
- Related: preprocessor directive, debugging, header file
Translating source code into machine code by preprocessing, compiling, assembling, and linking. The compiler reports syntax errors, while the linker resolves references to library and external functions.