$Id: review1a.txt,v 1.1 2005/09/15 21:42:52 locasto Exp $ Fall 2005 COMS1003 ---------------------------------------------------------------------- 0) What is the C programming language? C is a mid-level language that consists of three parts: 1) the core language (operators, keywords, basic symbols) as defined by the formal grammer and a compiler (e.g., gcc) 2) the standard library (collections of functions that perform specific tasks like input, output, math, file handling, etc.) 3) the execution environment (not really part of C, but defines what functionality C has access to) 1) Is the C preprocessor part of C? It depends. The C preprocessor language is not C. It is a macro language (a language designed for expansion and replacement of symbols) that contains strings that expand to legal C statements after the preprocessor runs. Most C programs rely in part on the C preprocessor. 2) Where does program execution begin in C? Control flow begins at: int main(int argc, char* argv[]) { } which is the special function called 'main' 3) How do you compile a C program? The Gnu C Compiler is used to compile C programs via: $ gcc myprogram.c This produces an executable file called a.out You can tell gcc to rename this file to something more meaningful by: $ gcc -o TurboTaxWiz3000 my_ugly_tax_program.c This tells gcc to rename the executable that results from compiling 'my_ugly_tax_program.c' to the file name immediately following the '-o' option. 4) What does the printf() function do? The printf() function is part of the standard library and is defined in the header file 'stdio.h'. printf is the traditional method of printing or writing program output to the screen. The printf() function is actually quite complicated: it takes a variable number of arguments, but the first argument is a string that specifies the format of the output. 5) What are the basic elements of a C program? The basic elements are variables and functions: data and the statements that operate on that data. 6) How do you form a single line comment in C? Start the line with // 7) How do you form multi-line comments in C? Start with /* and end with */ 8) What facility can help you learn more about how to use functions in the standard library? The Unix 'man' or manual pages. Type 'man man' at the command prompt for more detail. 9) What is the software lifecycle? A structured approach to providing computational solutions to problems.