004 - PRE-DEFINED FUNCTIONS

Cards (31)

  • Strings
    • These are actually one-dimensional array of characters terminated by a null characters terminated by a null character ‘\0’.
  • 80
    • The safest size option when the size of the array is unknown.
  • strcpy (s1, s2);
    • Copies string s2 into string s1.
  • strcat (s1, s2);
    • Concatenates string s2 onto the end of string s1.
  • strlen (s1);
    • Returns the length of string s1.
  • strcmp (s1, s2);
    • String comparison
    • Returns 0 if s1 and s2 are the same; less than 0 if s1 < s2; greater than 0 if s1 > s2.
  • strchr (s1,s2);
    • Returns a substring of string beginning at the first occurrence of character c(count) up to the end of string.
  • strrev(string)
    • Reverses all characters except the null terminator in the string.
  • Power Function
    • The pow function is used to calculate the power of the base raised to the power of the exponent.
  • Power Function
    • It accepts two double values as arguments which are the base and exponents numbers and it returns a single double integer which is base to the power of exponent.
  • POWER FUNCTION SYNTAX
    • double pow(double, double)
  • SQRT FUNCTION
    • Sqrt function in C++ returns the square root of the double integer inside the parameter list.
  • SQRT FUNCTION SYNTAX
    • double sqrt(double)
  • LOG FUNCTION
    • The log function is used to find the natural log of the given number.
    • This method accepts single double integer value finds logarithmic value and returns a double integer result of log()
  • FLOOR FUNCTION
    • The floor function is used to return the floor value of the given double integer floor value means rounded down value.
  • FLOOR FUNCTION SYNTAX
    • double floor(double)
  • CEILING FUNCTION
    • The ceil function is used to return the ceil value of the given double integer.
    • Ceil value means rounded up value.
  • CEILING FUNCTION SYNTAX
    • double ceil(double)
  • ABSOLUTE VALUE FUNCTION
    • The abs function returns the absolute value of the integer value.
    • The function accepts an integer value and returns an integer value that has the same magnitude but positive sign.
  • ABSOLUTE VALUE SYNTAX
    • double abs(double)
  • int isalnum(int c)
    • This function checks whether the passed character is alphanumeric.
  • int isalpha(int c)
    • This function checks whether the passed character is alphanumeric.
  • int iscntrl(int c)
    • This function checks whether the passed character is control character.
  • int isdigit(int c)
    • This function checks whether the passed character is decimal digit.
  • int isgraph(int c)
    • This function checks whether the passed character has graphical representation using locale.
  • int islower(int c)
    • This function checks whether the passed character is lowercase letter.
  • int isprint(int c)
    • This function checks whether the passed character is printable.
  • int ispunct(int c)
    • This function checks whether the passed character is a punctuation character.
  • int isspace(int c)
    • This function checks whether the passed character is white-space.
  • int isupper(int c)
    • This function checks whether the passed character is an uppercase letter.
  • int isxdigit(int c)
    • This function checks whether the passed character is a hexadecimal digit.