Saturday 2 August 2014

Excerpts from the book of "The C programming language"

"A character written between single quotes represents an integer value equal to the numerical value of the character in the machine’s character set. This is called a character constant, although it is just another way to write a small integer."

"Parameter names need not agree. Indeed, parameter names are optional in a function prototype, so for the prototype we could have written int power(int, int);" 

"""One aspect of C functions may be unfamiliar to programmers who are used to some other languages, particulary Fortran. In C, all function arguments are passed ‘‘by value.’’ This means that the called function is given the values of its arguments in temporary variables rather than the originals. This leads to some different properties than are seen with ‘‘call by reference’’ languages like Fortran or with var parameters in Pascal, in which the called routine has access to the original argument, not a local copy."""

"The story is different for arrays. When the name of an array is used as an argument, the value passed to the function is the location or address of the beginning of the array - there is no copying of array elements. By subscripting this value, the function can access and alter any argument of the array."




















No comments:

Post a Comment