Chapter 6. Functions and an Introduction to Recursion

  • The promotion
    rules indicate how to convert between types without losing data.
  • Useful function is cstdlib header file:

atof

Convert string to double

atoi

Convert string to integer

atol

Convert string to long integer

bsearch

Binary search in array

qsort

Sort elements of array

 

  • Useful functions in ctime.h:

clock

Returns the number of clock ticks elapsed since the program start.

difftime

Return difference between two times

time

Get current time

 

  • An identifier’s linkage determines whether an identifier is known only in the source file where it is declared or across multiple files that are compiled, then linked together. An identifier’s storage-class specifier helps determine its storage class and linkage.
  • Local variables are of automatic storage class by default, so keyword auto rarely is used.
  • Automatic storage is an example of the

2 thoughts on “Chapter 6. Functions and an Introduction to Recursion

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s