• The format of a procedure
    • The prototype
    • type identifier (type1, type2, ...);
      
    • And the implementation.
    • type identifier (type param1, type param2, ...) {
          variable declarations;
      
          statements;
          return();
      }
      	
    • Please note, the number and value of parameters must match in
      • Number
      • Type
  • And the program should now have the form
    • /* block comment */
      #include <files>
      
      constant declarations
      
      function prototype declarations
      
      int main () {
         variable declarations
      
         statements;
      
         return(0);
      }
      
      function implementations
      	
  • Some String functions
    • length
      • size
      • New type (sort of )
      • string::size_type len;
      • Some code
    • find
      • Locate a pattern within a string
      • Not found returns string::nopos
      • Find eather a char or a string
      • Some code
    • substr
      • extracts a substring from a string
      • two parameteres, start postion and length.
      • If you give bad parameters, you have a problem.
      • Consider this code
  • Some math odds and ends
    • autoinitialization
      • int a;
        a = 0;
        	   
      • type identifier=value;
      • Works for multiples.
      • int a = 5,
            b = 9;
        	    
    • Auto increment
      • i = i + 1;
      • Prefix
        • i++;
      • Postfix
        • ++i;
    • Consider this code