C Language – Beginners info

data types

  • bool, a Boolean expression of either true or false
  • char, a single character like a or 2
  • double, a floating-point value with more digits than a float
  • float, a floating-point value, or real number with a decimal value
  • int, integers up to a certain size, or number of bits
  • long, integers with more bits, so they can count higher than an int
  • string, a string of characters

CS50 Library

  • get_char
  • get_double
  • get_float
  • get_int
  • get_long
  • get_string

printf format codes

  • %c for chars
  • %f for floats or doubles
  • %i for ints
  • %li for long integers
  • %s for strings

mathematical operators

  • + for addition
  • - for subtraction
  • * for multiplication
  • / for division
  • % for remainder


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *