Pathway Introduction: Information Technology

Pathway Introduction: Information Technology

String Messy Details Unsigned vs signed String Literals are not Strings Strings Other things (const char[] )

Chars Unsigned vs Signed Unsigned integer : unsigned int Plain binary 11111111111111111111111111111111 4 billion

Signed (regular) integer : int Two's complement 11111111111111111111111111111111 = -1 Comparing Signed & Unsigned

Weirdness: Strings & Unsigned String namespace defines a type size_type: string::size_type Used to specify size and locations in string

string::size_type length(); string::size_type find(string); It is (usually) an unsigned int So?

strValue.find(str) works different in these cases: So? strValue.find(str) works different in these cases:

4 billion -1 npos string::npos

Constant for largest possible value for string::size_type Use to check for "not in string" if( strVar.find(str) == string::npos ) { //did not find str

} So what do I do? Use -1 Direct comparison with function is warning

So what do I do? Use string::npos Value stored as int will cause warning So what do I do? Use string::npos and store as unsigned int

No warnings So what do I do? Use string::npos and store as size_type Super correct

Recently Viewed Presentations

  • Discussion and analysis of the major trials in

    Discussion and analysis of the major trials in

    Discussion and analysis of the major trials in invasive aspergillosis David W. Denning Director, National Aspergillosis Centre University Hospital of South Manchester [Wythenshawe Hospital]
  • AstraZeneca PHB Workshop

    AstraZeneca PHB Workshop

    493.1413(b)(8)(9) & 1451(b)(8)(9)— Technical Consultant/Supervisor . Responsibilities— Evaluating the competency of all testing personnel & assuring that the staff maintain their competency to perform test procedures & report test results promptly, accurately, & proficiently.
  • Teach English A training Course for teachers Adrian Doff ...

    Teach English A training Course for teachers Adrian Doff ...

    Writing prompts for practice. Drawing a picture. Presenting structures. Drawing tables, diagrams ... Listening is word by word and at an unnaturally slow speed. GuidedWriting. ... Teach English A training Course for teachers Adrian Doff Cambridge University Press 2004
  • CHAPTER 10 Information Systems within the Organization CHAPTER

    CHAPTER 10 Information Systems within the Organization CHAPTER

    How Transaction Processing Systems Manage Data 10.2 Functional Area Information Systems Functional Area Information Systems are designed to support a functional area by increasing its internal effectiveness and efficiency in the following areas: Accounting Finance Marketing Operations (POM) Human Resources...
  • InkFormulation Training - SDC

    InkFormulation Training - SDC

    Identify This Colour. Identify This Color. Let's play with our eyes! Identify this color - - paper and pen. Is it rose, fuchsia, pink, pale magenta, blissful blush, candy desire?
  • Normal Vision: Age is in the Eye of

    Normal Vision: Age is in the Eye of

    VERNIER ACUITY Observer is asked to align objects, not recognize them (hyperacuity task) Segments of a line, points of light, etc. are aligned vertically or horizontally This ability remains intact throughout life VERNIER ACUITY STILES-CRAWFORD EFFECT Tests the directional sensitivity...
  • The Chemistry of Life

    The Chemistry of Life

    Tahoma Arial Calibri Office Theme 1_Office Theme Biology Do Now 2-14-19 Biology Do Now 2-14-19 Key Biology Homework - Due on Friday, 2/15/19 Objective Biomolecules (Updated) THE CHEMISTRY OF LIFE The Macromolecules of life CARBOHYDRATES Carbs cont. Lipids Lipids cont....
  • What is a psychoactive drug - NCETA

    What is a psychoactive drug - NCETA

    Making Sense of Drug Use A Basic Drive? Psychoactive drug use is a ubiquitous thread in human history. It has been argued that the pursuit of intoxication is a fourth basic physiological drive, along with hunger, thirst and sex.