C/C++ Commonly Used Libraries

This document references the C/C++ libraries most commonly used in CSCI 1301 and CSCI 1302. Each library name is accompanied by a description of its purpose and the functions/identifiers most commonly used from that library.
Library fileDescriptionCommon functions/identifiers
iostreamBasic input and output operations
  • cin, cout, cerr
  • << insertion operator
  • >> extraction operator
  • endl
  • getline() string input function
  • ios flags: fixed, scientific, showpoint, noshowpoint
iomanipOutput formatting manipulators
  • setprecision(n)
  • setw(n)
conioConsole (monitor) controls
  • clrscr();
cstdlibStandard library functions
  • abs(integervalue); labs (longvalue);
  • exit(status);
  • rand(); srand(seed);
  • atof(charvalue); atoi(charvalue); atol(charvalue);
cmathMathematical functions and formulas
  • pow(base, exponent);
  • sqrt(value);
  • fabs(floatvalue); dabs(doublevalue);
  • log(value); exp(value); // natural logarithm and ex
  • log10(value);
  • sin(value); cos(value); tan(value);
  • asin(value); acos(value); atan(value);
  • sinh(value); cosh(value); tanh(value); // hyperbolic functions
  • ceil(value); floor(value);
cctypeCharacter manipulation functions
  • isalpha(value); isdigit(value); isalnum(value); isspace(value); iscntrl(value); ispunct(value);
  • toupper(charvalue); tolower(charvalue);
stringString class and associated operations
  • string data type
vectorVector class and associated operations
  • vector data type
fstreamText file classes and associated operations

Use your browser's "Back" button to return to your course library.