Appendices Ronald J Leach Copyright Ronald J Leach

  • Slides: 13
Download presentation
Appendices Ronald J. Leach Copyright Ronald J. Leach, 1997, 2009, 2014, 2015 1

Appendices Ronald J. Leach Copyright Ronald J. Leach, 1997, 2009, 2014, 2015 1

Appendix 1: An Interesting Google Patent Copyright Ronald J. Leach, 1997, 2009, 2014, 2015

Appendix 1: An Interesting Google Patent Copyright Ronald J. Leach, 1997, 2009, 2014, 2015 2

Even Google uses flowcharts • A U. S. Patent • “Automatically Enabling Private Browsing

Even Google uses flowcharts • A U. S. Patent • “Automatically Enabling Private Browsing of a Web Page, and Applications Thereof” • invented by Michael David Smith • Assigned to Google on January 13, 2015 Copyright Ronald J. Leach, 1997, 2009, 2014 3

A flowchart in a Google patent Copyright Ronald J. Leach, 1997, 2009, 2014 4

A flowchart in a Google patent Copyright Ronald J. Leach, 1997, 2009, 2014 4

Appendix 2: Command-Line Arguments Copyright Ronald J. Leach, 1997, 2009, 2014, 2015 5

Appendix 2: Command-Line Arguments Copyright Ronald J. Leach, 1997, 2009, 2014, 2015 5

Command-Line Arguments • Used in programming shells, such as in Linux, UNIX, and MS/DOS

Command-Line Arguments • Used in programming shells, such as in Linux, UNIX, and MS/DOS • Allow extremely flexible programming Copyright Ronald J. Leach, 1997, 2009, 2014 6

Command-Line Arguments in C • argc is a count of the number of commandline

Command-Line Arguments in C • argc is a count of the number of commandline arguments • argv is an array of pointers to characters (in common use, argv is an array of character strings) Copyright Ronald J. Leach, 1997, 2009, 2014 7

Sample code #include <stdio. h> int main(int argc, char *argv[] ) { int i;

Sample code #include <stdio. h> int main(int argc, char *argv[] ) { int i; puts("The arguments to this function are: "); for (i = 0; i < argc; i++) printf("%sn", argv[i]); printf("n"); } Copyright Ronald J. Leach, 1997, 2009, 2014 8

Output in Linux, UNIX • In Linux and UNIX, the default name for an

Output in Linux, UNIX • In Linux and UNIX, the default name for an executable file is a. out • Hence, typing the command line in a command shell a. out gives the output a. out since argc is 1 and argv[0] is “a. out” Copyright Ronald J. Leach, 1997, 2009, 2014 9

Output in MS/DOS • In MS/DOS, the default name for an executable file from

Output in MS/DOS • In MS/DOS, the default name for an executable file from progname. c is progname • Hence, typing the command line in a command shell progname gives the output progname since argc is 1 and argv[0] is “progname” Copyright Ronald J. Leach, 1997, 2009, 2014 10

Output in Linux, MS/DOS Typing the command line in a command shell a. out

Output in Linux, MS/DOS Typing the command line in a command shell a. out Fred Marie Harry Computer Science gives the output a. out Fred Marie Harry Computer Science Here, argc is 6 argv[0] is “a. out”, argv[1] is “Fred”, argv[2] is “Marie”, argv[3] is “Harry”, argv[4] is “Computer”, argv[5] is “Science” Copyright Ronald J. Leach, 1997, 2009, 2014 11

Some flowchart symbols Process Data Document Predefined Process Copyright Ronald J. Leach, 1997, 2009,

Some flowchart symbols Process Data Document Predefined Process Copyright Ronald J. Leach, 1997, 2009, 2014 12

More flowchart symbols Predefined Process (Subroutine) Internal Data Copyright Ronald J. Leach, 1997, 2009,

More flowchart symbols Predefined Process (Subroutine) Internal Data Copyright Ronald J. Leach, 1997, 2009, 2014 13