Back to main

Glossary


Actual Parameter
address
ANSI C
ANSI Codes
argc
argv
Assignment
Assignment Operator
ASCII Codes
Assembler
Assembly Code
atoi(), atof(), atol()
Bitfield
Bitmap
Block
Borland
Breakpoints
Calloc/Malloc differences
Compound Statement
Clipboard
CodeView
Compile time
Compiling
Constants
Contiguous
Cut and Paste
Data
Data Type
Descriptor
Debug
Dialog boxes
Disk
DOS
DOS Path
Escape Sequences
Environment Variable
envp
Executable Code
Expression
External References
File Extension
Filename
fgetc()
fgets()
Formal Parameter
fputc()
fputs()
fprintf()
fread()
Functional Decomposition
fwrite()
fscanf()
getchar()/getc()
gets()
Global or Extern
Header File
Heap
Help
Hypergraphic
Hyperlink
Hypertext
I/O Redirection
IBM PC
Include File
Instruction
Iteration
Keywords
Libraries
Linear Address Space
Linking
Local or Auto
lvalue
Machine Code
Maintainable
makefile
Math Library
Memory Leak
Metafile
Microsoft
Mnemonic
MSVC
Object Code
Operand
Overlay Linking
Physical Address Space
Portability
Position Dependent Code
Position Independent Code
Pre-processor
Project
Prototype
Programme
printf()
putchar()/putc()
puts()
Qualifier
QuickC
Readable
Reference
Register
Return Value
Relocatable Code
Root Directory
Run time
Run-Time Library
scanf()
Segment
Segment Register
Segmentation Fault
Selector
Sequence
Selection
Short Cut Keys
Source Code
Stack
Standard Files: stdin, stdout, stderr.
Static
Step Into
Step Over
Step Out
Step to Cursor
Standard IO Library
String Library
True
Type
Type Promotion
UNIX
void
Virtual Address Space
Watch Values
Wildcard
Windows
WordStar

Goto Glossary Index Page.. or press Back

ASCII Codes

ASCII Codes: The ÄSCII character set" contains the decimal and hexadecimal values of the extended ASCII (American Standards Committee for Information Interchange) character set. The extended character set includes the ASCII character set and 128 other characters for graphics and line drawing, often called the ÏBM character set."

There are a number of variants on the IBM character set, called "code pages." Systems sold in some European countries use the multilingual character set known as Code Page 850, which contains fewer graphics symbols and more accented letters and special characters.

See also ANSI Codes.

ANSI Codes

ANSI Codes: The ANSI character code chart lists the extended character set of most of the programs used by Windows. The codes of the ANSI (American National Standards Institute) character set from 32 through 126 are displayable characters from the ASCII character set. The ANSI characters displayed as solid blocks are undefined characters and may appear differently on output devices.

See also ASCII Codes.

ANSI C

ANSI C: The American National Standard Institute. In 1983, the American National Standards Institute, ANSI, established the goal of producing an unambiguous and machine-independent definition of the language C. The result is the ANSI C standard.

argc

argc: An integer specifying how many arguments are passed to the program from the command line. Since the program name is considered an argument, argc is at least one.

Syntax:

main( int argc, char *argv[ ] )
{
        program-statements
}
The main function is the name of the function that marks the beginning and end of program execution. A C or C++ program must have one function named main. The main function can take the three optional arguments, traditionally called argc, argv, and envp (in that order):

See also argv and envp.

argv

argv: An array of null-terminated strings. It can be declared as an array of pointers to char (char *argv[ ]) or as a pointer to pointers to char (char **argv). The first string (argv[0]) is the program name, and each following string is an argument passed to the program from the command line. The last pointer (argv[argc]) is NULL.

Syntax:

main( int argc, char *argv[ ] )
{
        program-statements
}
The main function is the name of the function that marks the beginning and end of program execution. A C or C++ program must have one function named main. The main function can take the three optional arguments, traditionally called argc, argv, and envp (in that order):

See also argc and envp.

envp

enpv: A pointer to an array of environment strings maintained by the operating system and used by applications. It can be declared as an array of pointers to char (char *envp[ ]) or as a pointer to pointers to char (char **envp). The end of the array is indicated by a NULL pointer.

Syntax:

main( int argc, char *argv[ ], char *envp[ ] )
{
        program-statements
}
The main function is the name of the function that marks the beginning and end of program execution. A C or C++ program must have one function named main. The main function can take the three optional arguments, traditionally called argc, argv, and envp (in that order):

See also argc and argv.

atof(), atoi(), atol()

Syntax:

        double atof( const char *string );
        int atoi( const char *string );
        long atol( const char *string );
atof, atoi, and atol convert a character string to a double-precision floating-point value (atof), an integer value (atoi), or a long integer value (atol).

Parameter Description:
string - String to be converted

Compatibility Rules:

#include <math.h>               For atof.
#include <stdlib.h>     For atof, atoi, and atol.
Return Value:

Each function returns the double, int, or long value produced by interpreting the input characters as a number. The return value is 0 (for atoi), 0L (for atol), or 0.0 (for atof) if the input cannot be converted to a value of that type. The return value is undefined in case of overflow.

Static

Static: data comprises extern (global) and static items, strings, array and structures. Static variables are usable (in scope) within just the compound statement or file in which they are declared. The contents of such a variable is retained after it is out of scope, and becomes accessible once more when the variable comes back into scope.

Stack

The stack is a LIFO (last-in-first-out) data storage structure. Data added to the stack ("pushed onto the stack") can be retrieved later ("popped from the stack"), subsequent retrievals recovering data in the reverse order to which it was pushed.

The stack is used to store return addresses of functions so that the program continues execution whence it was called when a fuction edits. It is also used to store certain data.

Stack data comprises local (automatic) variables, strings, array and structures and function parameters. Stack variables are usable (are within scope) within just the function or block of code in which they are declared. Values of local variables are popped from the stack and thus lost on exit from that function/block.

Heap

Heap: data comprises dynamic data structures referenced by one or more pointers and allocated via malloc(). Heap variables are usable (have scope) with respect to their parent pointer. Contents (memory) is KEPT on exit from that function / block until a memory deallocation occurs using free().

void

Void: The keyword void has three uses. To specify a function return type, to specify an argument-type list for a function that takes no arguments, and to specify a pointer to an unspecified type. You can use the void type to declare functions that return no value or to declare a pointer to an unspecified type.

If a function prototype's parameter list contains only the keyword void, the compiler expects zero arguments in the function call and zero parameters in the definition. A diagnostic message is issued if it finds any arguments.

Address

Address: a number uniquely identifying a location in memory

Assembler

Assembler: a piece of software that turns assembly code into executable machine code.

Assembly Code

Assembly Code: a low level code specific to a hardware family and processed by an assembler.

Bitfield

Almost always, a "generic" variable type should be used when programming, i.e. double for floating point numbers and int for fixed point ones. Although an extremely modest space saving can be made using float or short ints, processors are almost always optimise to perform better using the default types.

An exception is when accessing registers on very small machines. Here it might be desired to name parts of the register which modifies the behaviour of a peripheral chip appropriately. In these cases a structure can be declared containing appropriately named integers of specific bit-lengths to be used. Such integers are then packed by the compiler into a single structure which, when accessed, permits easy modification of particular bits within a single memory word.

Beware order of packing and padding rules associated with the locally-installed compiler, as they may result in unexpected behaviour. Remember also to specify unsigned int bitfields: otherwise, for example, a single bit will be allowed the values -1 and 0 rather than the expected 1 and 0.

Bitmap

Bitmap: an image file format where each pixel is stored as: 1 bit Monochrome (1 colour)

4 bits/pixel (16 colours)

8 bit/pixel (256 colours)

16 bits/pixel High Colour (64K colours)

24 bits/pixel True Colour (16M colours)

Cut and Paste

Cut And Paste: a method to cut or copy and move text around.

In order to do this relevant text must first be marked (Highlighted) by either:

i) Moving the text cursor over the text while holding the down the LEFT MOUSE key.

ii) Moving the text cursor over the wanted text and using SHIFT+ARROW keys.

The marked text may then be copied into an area of memory (a buffer) called the clipboard. This is common to ALL programs running in Microsoft Windows and allows copying not only to other areas of the current source file within the editor but also to other source files and even to different Windows software.

To copy the text, use the Copy command on the Edit Menu.

The cursor can then be moved to the position in the current file (or even a different file) where the text is to be copied to and then use the Paste command, again on the edit menu to insert the text in the new position.

If the marked text is Cut instead of copied from the source file,a copy is made to the buffer while the text is deleted from it's original location in the source file. This can then be Pasted to a new location.

Constants

Constant: Refers to an identifier whose value is fixed at the start of a program and is unable to change during the program execution. e.g. const char c = 'a'; const int i=42; const float pi=3.141592; const double dpi=3.141592653589793; const char sting[]="fred";

Contiguous

From the latin meaning literally "touching together", contiguous data is stored in adjacent memory locations and thus occupies a block of sequential addresses in memory. Array storage is an example.

DOS Path

DOS Path: When a command is entered at the DOS prompt, DOS searches the current directory for a file with the same filename and one of the following file types;

i) .COM (command file),
ii) .EXE (executable file) or
iii) .BAT (batch file).
 

If one is found then it is loaded into memory and executed. If files of the same filename but differing file types are found in the same directory (e.g. MYFILE.EXE, MYFILE.COM and MYFILE.BAT) then order of precedence for execution is COM, EXE, BAT (e.g. MYFILE.COM would be executed in preference to MYFILE.EXE, but MYFILE.EXE would be run in preference to MYFILE.BAT).

Metafile

Metafile: an image file format where each image is stored as a collection of graphical objects or primitives along with is geometric and size information.

Standard Files, stdin, stdout, stderr

Standard input/output streams stdin, stdout and stderr: These are standard streams for input, output, and error output. By default, standard input is read from the keyboard, while standard output and standard error are printed to the screen.

The following stream pointers are available to access the standard streams:

Pointer        Stream                          Device
------------------------------------------------------------------
stdin          Standard input                 Keyboard
stdout         Standard output                Screen
stderr         Standard error                 Screen
These pointers can be used as arguments to functions; some functions, such as getchar() and putchar() , use stdin and stdout automatically.

True

TRUE and FALSE: These are constants equivalent to 1 and 0 respectively. They are often declared via a header file as:
#define FALSE  0
#define TRUE   !FALSE

Math Library

The math library routines allow you to carry out scientific and engineering calculations. MSCV provides the following math functions. To inform the compiler you intend to use any of these remember to include the file math.h. For specific details see your on-line help.

Routine Description

acos, acosl     Calculate the arccosine
asin, asinl     Calculate the arcsine
atan, atanl     Calculate the arctangent
atan2, atan2l   Calculate the arctangent
Bessel          Calculates Bessel functions
ceil, ceill     Find the integer ceiling
cos, cosl       Calculate the cosine
cosh, coshl     Calculate the hyperbolic cosine
div             Divides one integer by another, returning the quotient and remainder
exp, expl       Calculate the exponential function
fabs, fabsl     Find the absolute value
floor, floorl   Find the largest integer less than or equal to the argument
fmod, fmodl     Find the floating-point remainder
frexp, frexpl   Calculate an exponential value
ldexp, ldexpl   Calculate the product of the argument and 2exp
ldiv            Divides one long integer by another, returning the quotient and remainder
log, logl       Calculate the natural logarithm
log10, log10l   Calculate the base-10 logarithm
modf, modfl     Split the argument into integer and fractional parts
pow, powl       Calculate a value raised to a power
rand            Gets a pseudorandom number
sin, sinl       Calculate the sine
sinh, sinhl     Calculate the hyperbolic sine
sqrt, sqrtl     Find the square root
srand           Initializes a pseudo-random series
tan, tanl       Calculate the tangent
tanh, tanhl     Calculate the hyperbolic tangent

Standard IO Library

Standard Input Output Library/Functions: allow you to carry out formatted and unformatted input-output via the standard input standard output and file input and output streams.

Routine Description

clearerr        Clears the error indicator for a stream
fclose          Closes a stream
feof            Tests for end-of-file on a stream
ferror          Tests for error on a stream
fflush          Flushes a stream
fgetc           Reads a character from a stream (function version)
fgetpos         Gets the position indicator of a stream
fgets           Reads a string from a stream
fopen           Opens a stream
fprintf         Writes formatted data to a stream
fputc           Writes a character to a stream (function version)
fputs           Writes a string to a stream
fread           Reads unformatted data from a stream
freopen         Reassigns a FILE pointer to a new file
fscanf          Reads formatted data from a stream
fseek           Moves file position to a given location
fsetpos         Sets the position indicator of a stream
ftell           Gets current file position
fwrite          Writes unformatted data items to a stream
getc            Reads a character from a stream
getchar         Reads a character from stdin
gets            Reads a line from stdin
printf          Writes formatted data to stdout
putc            Writes a character to a stream
putchar         Writes a character to stdout
puts            Writes a line to a stream
rewind          Moves file position to beginning of a stream
scanf           Reads formatted data from stdin
setbuf          Controls stream buffering
setvbuf         Controls stream buffering and buffer size
sprintf         Writes formatted data to a string
sscanf          Reads formatted data from a string
tmpfile         Creates a temporary file
tmpnam          Generates a temporary filename
ungetc          Places a character in the buffer
vfprintf        Writes formatted data to a stream
vprintf         Writes formatted data to stdout
vsprintf        Writes formatted data to a string

String Library

String Library/Functions: allow you to compare strings, copy them, search for strings and characters, and perform various other operations.

Routine Description

strcat, _fstrcat        Append one string to another
strchr, _fstrchr        Find first occurrence of a given character in a string
strcmp, _fstrcmp        Compare two strings
strcpy, _fstrcpy        Copy one string to another
strcspn, _fstrcspn      Find first occurrence of a character from a given character set in a string
strerror                Maps an error number to a message string
strlen, _fstrlen        Find length of string
strncat, _fstrncat      Append characters of a string
strncmp, _fstrncmp      Compare characters of two strings
strncpy, _fstrncpy      Copy characters of one string to another
strpbrk, _fstrpbrk      Find first occurrence of a character from one string in another
strrchr, _fstrrchr      Find last occurrence of a given character in string
strspn, _fstrspn        Find first substring from a given character set in a string
strstr, _fstrstr        Find first occurrence of a given string in another string
strtok, _fstrtok        Find next token in a string

Dialog boxes

Dialog Box: A pop-up sub-window used enter data and to receive information from the application.

fprintf()

The fprintf function formats and prints a series of characters and values to the output stream. Each argument (if any) is converted and output according to the corresponding format specification in format. The format argument has the same form and function that it does for the printf function; see the printf function for more information on format and argument.

The fprintf function returns the number of characters printed, or a negative value in the case of an output error.

See also File Functions.

printf()

printf(): A function to output a string to the standard output stream (stdout). It is able to handle both characters and escape sequences.

To use this function include the line #include<stdio.h> in your program.

See also Standard Input Output.

fread()

The fread function reads up to count items of size bytes from the input stream and stores them in buffer. The file pointer associated with stream (if there is one) is increased by the number of bytes actually read. If the given stream is opened in text mode, carriage-return-line-feed pairs are replaced with single line-feed characters. The replacement has no effect on the file pointer or the return value.

The file-pointer position is indeterminate if an error occurs. The value of a partially read item cannot be determined.

The fread function returns the number of full items actually read, which may be less than count if an error occurs or if the file end is encountered before reaching count.

The feof or ferror function should be used to distinguish a read error from an end-of-file condition. If size or count is 0, fread returns 0 and the buffer contents are unchanged.

See also File Functions.

fwrite()

The fwrite function writes up to count items, of length size each, from buffer to the output stream. The file pointer associated with stream (if there is one) is incremented by the number of bytes actually written.

If stream is opened in text mode, each carriage return is replaced with a carriage-return-line-feed pair. The replacement has no effect on the return value.

The fwrite function returns the number of full items actually written, which may be less than count if an error occurs. Also, if an error occurs, the file-position indicator cannot be determined.

See also File Functions.

fscanf()

The fscanf function reads data from the current position of stream into the locations given by argument (if any). Each argument must be a pointer to a variable with a type that corresponds to a type specifier in format. The format controls the interpretation of the input fields and has the same form and function as the format argument for the scanf function; see scanf for a description of format.

The fscanf function returns the number of fields that were successfully converted and assigned. The return value does not include fields that were read but not assigned. The return value is EOF for an error or end-of-file on stream before the first conversion. A return value of 0 means that no fields were assigned.

See also File Functions.

scanf()

scanf(): A function to scan the input stream (stdin) for keyboard entries.

To use this function include the line #include<stdio.h> in your program.

See also Standard Input Output.

Calloc/Malloc differences

Calloc/Malloc differences: Whereas malloc() allocates a memory block of at least <size> bytes and returns a void pointer to the allocated space, the calloc() family of functions allocate storage space for an array of <num> elements, each <size> bytes in length and each element is initialized to 0.

Use your compiler's on-line help for a full description.

getchar()/getc()

getchar()/getc(): The getc routine reads a single character from the stream position and increments the associated file pointer (if there is one) to point to the next character. The getchar() routine is identical to getc(stdin). The getc() and getchar() routines are similar to fgetc() and _fgetchar(), respectively, but are implemented both as macros and functions. Both getc() and getchar() return the character read. A return value of EOF indicates an error or end-of-file condition. Use ferror() or feof() to determine whether an error or end-of-file occurred.

See Standard Input Output.

fopen()

Syntax:

    FILE *fopen( const char *filename, const char *mode );
Parameter Description:
filename - Filename
mode - Type of access permitted

The fopen function opens the file specified by filename. The character string mode specifies the type of access requested for the file, as follows:

Mode is a string containing the desired opening status. The ANSI standard for the possible modes is as follows:

        MODE            MEANING
        "rt"            Open text file for reading.
                        If the file does not exist or cannot be found, the fopen call will fail.
        "wt"            Create text file for writing.
                        If the given file exists, its contents are destroyed.
        "at"            Append to a text file.
                        Create the file first if it doesn't exist.

        "rb"            Open binary file for reading.
        "wb"            Create binary file for writing.
        "ab"            Append to a binary file.

        "r+"            Open text file for reading and writing.
                        The file must exist.
        "w+"            Create a text file for reading and writing.
                        If the given file exists, its contents are destroyed.
        "a+"            Open text file for reading and writing.
                        Create the file first if it doesn't exist.
        "rb+"           Open binary file for reading and writing.
        "wb+"           Create binary file for reading and writing.
        "ab+"           Open binary file for reading and writing.


"t" Open in text (translated) mode; CR+LF combinations are translated into single LF's on input. LF characters are translated to CR+LF combinations on output. Also , CTRL+Z is interpreted as an end-of-file

In files opened for reading or for reading/writing, fopen checks for a CTRL+Z at the end of the file and removes it, if possible. This is done because using the fseek and ftell functions to move within a file that ends with a CTRL+Z may cause fseek to behave improperly near the end of the file.

"b" Open in binary (untranslated) mode; the above translations are suppressed.

If t or b is not given in mode, the translation mode is defined by the default-mode variable _fmode. If t or b is prefixed to the argument, the function will fail and return NULL. The fopen function returns a pointer to the open file. A null pointer value indicates an error.

When a file is opened with the ä" or ä+" access type, all write operations occur at the end of the file. Although the file pointer can be repositioned using fseek or rewind, the file pointer is always moved back to the end of the file before any write operation is carried out. Thus, existing data cannot be overwritten. When the "r+", "w+", or ä+" access type is specified, both reading and writing are allowed (the file is said to be open for üpdate"). However, when you switch between reading and writing, there must be an intervening fflush, fsetpos, fseek, or rewind operation. The current position can be specified for the fsetpos or fseek operation, if desired. In addition to the values listed above, the following characters can be included in mode to specify the translation mode for newline characters:

See also File Functions.

Return Value: The fopen function returns a pointer to the open file. A NULL pointer value indicates an error.

e.g. FGETPUTC.C

fclose()

The fclose function closes stream. The fcloseall function closes all open streams except stdin, stdout, stderr (and in MS-DOS, _stdaux and _stdprn). It also closes and deletes any temporary files created by tmpfile(). In both functions, all buffers associated with the stream are flushed prior to closing. System-allocated buffers are released when the stream is closed. Buffers assigned by the user with setbuf and setvbuf are not automatically released.

The fclose function returns 0 if the stream is successfully closed. The _fcloseall function returns the total number of streams closed. Both functions return EOF to indicate an error.

See also File Functions.

fgets()

The fgets function reads a string from the input stream argument and stores it in string. Characters are read from the current stream position up to and including the first newline character '\n', up to the end of the stream, or until the number of characters read is equal to n-1, whichever comes first. The result is stored in string, and a null character '\0' is appended. The newline character, if read, is included in the string. The fgets function is similar to the gets function; however, gets replaces the newline character with NULL. If successful, the fgets function returns string. It returns NULL to indicate either an error or end-of-file condition. Use feof or ferror to determine whether an error occurred.

See also File Functions.

fgetc()

The fgetc() function reads a single character from the current position of the file associated with stream. The character is converted and returned as an int. The function then increments the associated file pointer (if any) to point to the next character. The fgetc() function returns the character read. They return EOF to indicate an error or end-of-file. Use feof or ferror to distinguish between an error and an end-of-file condition.

See also File Functions.

fputc()

The fputc function writes the single character c to the output stream at the current position. The fputc routine are similar to putc and putchar but are functions rather than macros. The fputc function returns the character written. A return value of EOF indicates an error.

See also File Functions.

fputs()

The fputs function copies string to the output stream at the current position. The terminating null character '\0' is not copied. The fputs function returns a nonnegative value if it is successful. If an error occurs, it returns EOF.

See also File Functions.

gets()

gets(): A function to read a line from the standard input stream (stdin) and store it in a buffer. The function will continue to read characters from the buffer until a newline character '\n' is reached. It will then replace the '\n' with a null termination character '\0' before returning the string to the program. Include the line #include<stdio.h> in your programs

See also Standard Input Output.

putchar()/putc()

putchar()/putc(): The putc() routine writes the single character c to the output stream at the current position. The putchar() routine is identical to putc(c, stdout).

These routines are implemented as both macros and functions. See Choosing Between Functions and Macros for a discussion of how to select between the macro and function forms.

The putc and putchar routines return the character written, or EOF in the case of an error. Any integer can be passed to putc, but only the lower 8 bits are written.

See also Standard Input Output.

puts()

puts(): A function to output a string to the standard output stream (stdout). It will replace the null termination '\0' on the string with a newline escape sequence '\n'. Include the line #include<stdio.h> in your programs.

See also Standard Input Output.

Environment Variables

Environment Variables: An array of environment strings maintained by the operating system and used by applications. Type "set" in DOS or "env" in UNIX to list the command shells environment.

Escape Sequences

Escape sequences are special character combinations that represent white space and non-graphic characters in strings and character constants. They can be used to specify actions on output (e.g. carriage return and line feed), and to provide literal representations of characters that normally have a special meaning (e.g. ' and "). The sequences\ddd and \xddd allow any character in the ASCII character set to be given in terms of its equivalent octal or hexadecimal representation.
Sequence Name Code Hex
\a Bell (alert) BEL \0x07
\b Backspace BS \0x08
\f  Form feed FF \0x0C
\n New line LF \0x0A
\r Carriage return CR \0x0D
\t Horizontal tab HT \0x09
\v Vertical tab VT \0x0B
\0 Null (String terminator) NUL \0x00
\\ Solidus ("Backslash") \ \0x5C
\' Single quotation mark ' \0x27
\" Double quotation mark " \0x22
\ddd ASCII character in octal
'ddd' refers to the three-digit octal number
\xdd ASCII character in hex
'dd' refers to the two-digit hexadecimal number

UNIX

UNIX was developed by AT T Bell Laboratories back in the dim and distant past. In spite of its age, it contiunes to evolve and is the most portable and general purpose of all operating systems. UNIX is in fact a trade mark of AT&T: more properly, OSs conforming to its standards are referred to as "Posix Compliant" (Portable Open System Interface: for more information consult the web page of the IEEE's Portable Application Standard's Committee. One day, an operating system incorporating all of the modern research which has since taken place may become more popular (for example, hurd), but until then, as one of the inventors of the original Unix wrote, "Those who don't understand Unix are condemned to reinvent it, badly". See Microsoft.

IBM PC

IBM PC is a trade mark of International Business Machines Corporation.

MicroSoft

Microsoft is a trademark of the Microsoft Corporation. The Microsoft Corporation is a monopolistic software company, famed as much for its low quality, difficult to use "productivity" suite Office as for its almost Posix-compliant, unreliable and very expensive operating system, Windows.

QuickC

QuickC: Integrated development environment which is not ISO C compliant. QuickC is a trademark of the Microsoft Corporation.

MSVC

MSVC: Microsoft Visual C / C++ integrated development environment. MSVC is a trademark of the Microsoft Corporation.

Windows

CodeView

CodeView is a trade mark of the Microsoft Corporation.

Clipboard

Clipboard: This a temporary area of memory maintained by the windowing system for cutting an pasting data between applications.

Borland

Borland is a trademark of Borland International.

WordStar

Wordstar is a trademark of Micro-Pro International Corporation.

Portability

Portability: The process by which code written for one machine is transported and run on another machine with a different processor; if this is achievable the code is said to be portable.

Short Cut Keys

Short Cut Keys - Short cut keys are used to provide a quick method of accessing regularly used commands by pressing a combination of keys from the keyboard. For example, to copy a marked block of text from the active editing window to the clipboard use CTRL + INS (Hold the CTRL key down and whilst holding this key down press the Insert key).

Filename

Filename: a tag or label give to a file. DOS filenames take the form FILENAME.EXT

File Extension

File Extension: This is the bit after the dot in a standard filename taking the form FILENAME.EXT

Source Code

Source Code: is the un-compiled program text which can be manipulated via a text editor. Source code in C usually has the extension ".C" or ".H" depending on whether the file contains functions definitions or declarations.

Compiler

Compiler: a piece of software that turn high level code into executable code.

Compiling

Compiling: is the process of converting source code. into object code.

Object Code

Object Code: is relocatable machine code and usually has the extension ".o". It is generated by a compiler from source code.

mnemonic

mnemonic: a set of abbreviations commonly used in assembler language.

Relocatable Code

Relocatable Code: is object code that can be run in any available memory region. In relocatable code the address of variables, functions or offsets are relative to the start of the object code.

Position Dependent Code

Position Dependent Code: is object code that can only run in a certain position in memory. All addresses are fixed to absolute positions in memory.

Position Independent Code

Position Independent Code: is object code that can only run in any position in memory. All addresses are relative to positions in memory.

Machine Code

Machine Code: is the sequence of binary instructions directly executable by the hardware.

Executable Code

Executable Code: is object code in which all external references have been resolved by the linker. In DOS executable code usually has the extension EXE.

makefile

makefile: tells a compiler or make utility how to build a program by defining the dependencies between executable, object and source code files. Having read the Makefile, the make utility is then able to build the project it describes using the minimum number of compiler invocations. It does this by examining the "last changed" date of all of the relevant source files, and only re-compiling and re-linking those which have been modified since the last build.

Project

A project is a set source files and information about a particular program or library that you want to build. The information contains at least the following:

Linking

Linking: is the process of combining various pieces of object code together and resolving external references in order to create an executable program.

External References

External References: are created when code in one file refers to code in another file such as a call to a library function, or a reference to a variable or function declared in another file.

Libraries

Libraries: are files of object code containing useful functions. Library files usually have the extension ".so" (for "Shared Object" or ".a" for "archive", except on Windows systems where the extensions ".dll" ("Dynamic Link Library") or ".lib" are preferred. Each C compiler is delivered with a group of standard functions (as specified by the ANSI) termed the "standard library".

Although library files are similar to object files the linker treats them differently.

Compiling

Compiling: refers to the process of translating human readable source code to machine readable object code.

Compile time

Compile time: refers to events that occur during the compilation process.

Register

Register: a one word physical memory location (latch) on the CPU itself.

Return

Return: Indicates a value is to returned by the function. Most (well behaved) programs return values to their calling function (or the operating system).

Return(0)

return(0): typically seen in the main() function indicates successful completion the program the function. A non-zero may indicate an error condition has occurred. The user, via the command shell, may choose to take some action with respect to the error condition.

I/O Redirection

I/O redirection: It is sometimes useful to redirect the output (input) of a program to (from) another file using the > symbol, e.g.
B:\ >  dir > temp.txt
redirects the output of the DOS command dir to the file temp.txt

Run time

Run time: refers to events that occur during the execution of the program.

Overlay Linking

Overlay Linking: is used to create an executable program which would otherwise be too large to fit into available memory. This is achieved by creating overlays (pieces of object code) that are stored on disk and only loaded and executed when needed. The area in memory in which the overlay is loaded is called the overlay region and it is, in effect, an area of memory shared by more than one piece of the object code.

Debug

Debug: The debug environment provides a means of examining the state of a executable program as it runs.

Most IDE's provide extensive debugging facilities for setting Breakpoints and Watch Values single stepping through your code with Step Into, Step Over, Step Out and Step to Cursor and viewing function calls by displaying the stack.

Breakpoint

Breakpoint: The debugger allows you to control the execution of your program, and examine its state at various points in its execution. In the debugger, you can specify the conditions under which to stop the execution of your program. These conditions are known as breakpoints. You can set breakpoints with the Breakpoints command on the Debug menu. You can also toggle a breakpoint using the Breakpoint button on the toolbar.

After setting breakpoints, you start execution of your program under the control of the debugger with the Go command on the Debug menu. Alternatively, you can execute your program a statement at a time, or step through your program. If you choose to step through your program, you can either enter the code for the function when it is called in a statement, using the Step Into command on the Debug menu, or skip over the code for the function, using the Step Over command. You can similarly exit from a called function with the Step Out command, which returns you to the statement where the function was called.

You can also place the insertion point on a line in a source file, and select the Step to Cursor command on the Debug menu. This runs your program until it arrives at the line containing the insertion point.

When you stop debugging, either by exiting the program or by selecting the Stop Debugging command, the project retains any breakpoints that you have set. If you close the project, it stores the breakpoints, and restores them when you open the project again. Your debugging can thus span sessions.

Watch Values

Watch Values: When the program is stopped, you can use the Watch window on the Windows menu and the Quick Watch dialog box on the Debug menu to examine the values of variables, and change them for subsequent program execution. The Watch window also displays the values of selected variables at each breakpoint. Other windows on the Window menu also display aspects of the program's state when it is paused. The Registers window displays the values of the registers in the CPU at the breakpoint. The Locals window displays the value of variables local to the current function. This window is updated every time the scope of variables in the program changes.

Step Into

Step Into: Steps through each program statement, stepping into function calls. Select Run followed by Step Into or use the appropriate function key

Step Over

Step Over: Steps through each program statement, stepping over function calls. Select Run followed by Step Over or use the appropriate function key

Step Out

Step Out: Steps through remaining program statement inside the current function back to the calling function. Select Run followed by Step Out or use the appropriate function key

Step to Cursor

Step to Cursor: Steps through program statement from the current debug position to the line selected by the cursor position. Select Run followed by Step to Cursor or use the appropriate function key

Local or Auto

Local or Auto: a variable which is only usable (or has scope) WITHIN just the function or block of code IN WHICH it is declared. Contents (memory) is LOST on exit from that function / block.

Global or Extern

Global or Extern: a variable which is only usable (or has scope) across all (or a number) of functions. Declared once OUTSIDE a function in one file, subsequently declared as extern in other files.

Static

Static: a variable which is only usable (or has scope) WITHIN just the function or block of code IN WHICH it is declared. Contents (memory) is KEPT lost on exit from that function / block.

DOS

DOS - Disk Operating System, simple sequential operating system for managing disks and files. Used on most PC type personal computers.

Disk

Disk: personal computer's own disk drive.

a: - first floppy disk drive b: - second floppy disk drive c: - first hard disk d: - etc..

Root Directory

Root Directory (\): the top most directory on a disk drive with the name \.

Wildcard

Wildcard: the sequences * and *.* are known as a wildcards and may be used in place of a filename or file type.

In DOS *.* literally means all files in the current directory with filenames of the form FILENAME.EXT

In UNIX * literally means all files in the current directory with filenames of any form !

On the command line prompt or sometime within an applications dialogue box it is possible to use a wildcard sequence. The command shell (or the application) will expand this to a list of matching filename

Help

Help: Microsoft MSVC and QuickC provide on-line help on all aspects of C (even if it is at times a little terse).

To get into the general help: Select from the Help menu the Contents item.

To get help on a specific topic: Select from the Help menu the Search item then type or choose the required help topic.

Alternatively simple highlight a word in the editor and hit the F1 function key.

Hypergraphic

Hypergraphic: are graphics that may be clicked upon in a similar manner to hypertext. When the cursor is on top of a hypergraphic region may be selected by moving the mouse on top of the graphic and clicking with the left mouse button

Hyperlink s

Hyperlink: a navigation aid used in hypertext documents to move from one page of information to another.

Hypertext

Hypertext: is the name given to computer based documents that combine text, images and sound within the framework of an interactive document. Hypertext is typically used in on-line Help Documents, Multimedia and Internet browsing tools.

Sequence

Sequence: refers to the normal sequential nature in which program statements execute. See also selection and iteration

Selection

Selection: refers to the use of control statements to alter the normal sequential nature in which program statements execute, usually accomplished with the if..else.. controls. See also sequence and iteration

Iteration

Iteration: refers to the use of control statements to alter the normal sequential nature in which program statements execute, usually accomplished with the for..do..while controls. See also sequence and selection.

Pre-processor

Pre-processor: refers to the first stage of the compilation process - sometimes called the first pass. This is when pre-processor directives such as #define statements are parsed and applied to the code before the real process of compilation begins.

Programme

Programme: A set of coded instructions, a computer programme, to be executed by a computer.

Data

Data: information required by a programme or operator. In the context of an operator the data may be referred to an an operand.

Data

Data: information required by a programme or operator. In the context of an operator the data may be referred to an an operand.

Operand

Operand: that item of data required by an operator. May be an variable, the result of an expression or some other object.

Instruction

Instruction: a single command that may be acted upon by the processor. Part of the instruction set.

Readable

Readability: that property of a piece of software code that renders it intelligible to the human reader.

Maintainable

Maintainable: that property of a piece of software that facilitates ease of updates and change.

Functional Decomposition

Functional Decomposition: is the process by which a complex task is broken down into its constituent sub-task.

Compound Statement

Compound Statement or Block: is a collection of statements enclosed by braces {}. No semicolon appears after the closing brace.
for( i=0 ; i<n ; i++)
{
        ...
}

Assignment

Assignment:
   Precedence     Operator        Name
      14           =               Simple assignment RIGHT to LEFT

Assignment Operator

Assignment Operator:
   Precedence     Operator        Name
      14          +=              Addition assignment           
                  -=              Subtraction assignment
                  *=              Multiplication assignsent
                  /=              Division assignment
                  %=              Remainder assignment
                  >>=             Right shift assignment
                  <<=             Left shift assignment
                  &=              Bitwise AND assignment
                  |=              Bitwise OR assignment
                  ^=              Bitwise exclusive OR assignment

Expression

Expression: An expression consists of an operator and its operands and it can occur whenever a value or expression is allowed. In its simplest form an expression may be just a constant or a variable. Expressions can be combined with operators to create new expressions.

An expression becomes a statement when it is terminated by a semicolon ;.

Keywords

Keywords: Keywords are reserved identifiers known to the compiler. As such they cannot be used as user defined identifiers.

Qualifier

Qualifier: is a modifier applied to a one of the standard data types. Type qualifiers can be one of signed, unsigned, short, or long.

Data Type/Type

Data Type: there are four basic simple data types. Data types can be one of character, integer, Floating point, Valueless. Compound types, such as structures or unions, can be constructed as a conglomoration of these simple types. Arrays represent collections of variables, all of the same type.

Type Promotion

The act of converting from one data type to another of greater precision. For example, in C, the expression 1/2 evaluates to 0, because both 1 and 2 are integers. But 1/2.0 evaluates to 0.5: the integer value 1 is promoted to a double-precision 1.0 before the expression is evaluated.

Header File/Include File

Header File/Include File: is a file of definitions and/or declarations that is included in you code as part of the first stage of the compilation process by the pre-processor.

See Pre-processor Directives for more information.

Physical Address Space

Physical Address Space: The physical memory in your system.

Linear Address Space

Older computers used to use segmented address model where memory address within the machine were broken into two parts: the segment register and offset. One segment might have been used to store the program, one the heap, one the stack and so on. Latterly, machines simply use an single number to refer to an address, although the concept of segments is still supported as ranges of addresses within memory.

Virtual Address Space

The virtual address is the address that the program uses to refer to variables, functions and so forth. It is translated by hardware into a machine address which is used to fetch data from the system's memory. Modern machines have the facility to use more virtual address space than there exists physical memory, because an area of the disk (a swap partition) can be used to hold data which is not currently in use, albeit at considerable impact on system performance. Each program has its own virtual address space, which prevents it from overwriting program and data used by other programs currently in the computer.

Segment

Segment: A portion of your program's linear virtual address space.

Descriptor

The information about each defined segment is stored in a table; each entry contains the location, size, permissions, and attributes of the segment. These entries are descriptors. When you put a selector into a segment register, the CPU really reads the whole descriptor into hidden registers for its own private use.

Selector

Selector: A number that selects one of the descriptors in the descriptor table.

Segment Register

A machine register that is used to refer to a segment.

Segmentation Fault

The act of accessing memory not allocated properly for use by the program causes a segmentation fault. The hardware of modern CPUs can detect when an attempt is made to access memory which has not been previously reserved. In order to prevent the program from behaving unpredictably, or even corrupting other programs and their data, it is interrupted and usually terminated with a message displayed on the console that a segmentation fault has occurred.

Run-Time Library

Run-Time Library: is important because it provides basic functions not provided by the C and C++ languages themselves. These functions include input and output, math, memory allocation, process control, graphics, and many others.

Prototype

The prototype of a function informs the compiler of the return type and of the type of the functions arguments in advance of their being called. It has exactly the same syntax as the function declaration, except that the block forming the function body is replaced by a semi-colon, and the name of the formal parameters may optionally be omitted.

Formal Parameter

The variable declared as an argument in a function definition. The scope of the formal parameters of a function is the body of the function. It is an error for a function to return a reference to a formal parameter.

Actual Parameter

The value or values passed to a function on its invocation. These values are typically pushed on to the stack before the function processes them, to ensure the values visible to the function are local in scope.

Reference

The address in memory of a variable or function.

lvalue

A value which may appear of the left of an assignment. For example, x (where x is a simple variable or pointer) or *p (where p is a pointer) are lvalues because their contents can be altered, whereas constants like 42 are not.

Memory Leak

Memory allocated using malloc or calloc has to be deallocated after use. Otherwise, the amount of system memory a program consumes slowly increases until system resources are exhausted. Forgetting to free up memory after allocating it is referred to as a memory leak. Unix implements a two-layer memory allocation policy, so that memory used by a program is always returned to the system in its entirety when the program completes, but this won't help processes designed to run indefinitely (for example, the notorious memory leak in the Microsoft web server which looses a small lump of memory every time a page is served, requiring the server machine to be periodically rebooted).

System Requirements

To view this web resource, you will need:

Copyright and Acknowledgements

The tools upon which this course relies are Copyright the Free Software Foundataion where they are made available under the GPL (GNU Public Licence).

The content of this course was derived from that generated by many ex-colleagues at the University of Leeds, Department of Electronics and Electrical Engineering. Much of the content has been reworked, and substantially augmented, but Dr N J Bailey, Centre for Music Technology, The University of Glagsow. This manifestation is Copyright N J Bailey; some of the content is Copyright The University of Leeds.

Diagrams on this resource are drawn in XFig and are rendered by the browser using The University of Hamburg's Simple FIG viewer applet which is Copyright (C) 1996-2002 F.N.Hendrich, hendrich@informatik.uni-hamburg.de.

The source code, programming examples and exercises are all specific to this course, and are Copyright, Dr N J Bailey.

The applet for viewing and demonstrating C programs is Copyright Dr N J Bailey, and is to be found documented and with its source code on the Centre for Music Technology website under Software