Get 1 week of unlimited access
Class Notes (1,033,491)
US (405,853)
CSCI (23)
CSCI 10 (18)
Lecture 14

# CSCI 10 Lecture Notes - Lecture 14: Grace Hopper, Null Character, C String HandlingPremium

2 pages66 viewsFall 2016

Department
Computer Science
Course Code
CSCI 10
Professor
Bannister
Lecture
14

This preview shows half of the first page. to view the full 2 pages of the document.
CSCI 10 Day 13
GRACE HOPPER AND C-STRINGS
Announcements
LECTURE
Arrays recap
When youre trying to understand things, its better to use int as data type
and change later when necessary
Array functions always have to take in the array variable and its size
variable
*Find the max value/general algorithm for finding an element in an
array:
int argmax(int A[], int sz, int& max_value) {
int max_index = 0;
max_value = A[max_index];
for (int i = 1; i < sz; i++) {
if (A[i] > max_value) {
max_index = i;
max_value = A[i];
}
}
return max_index;
}
Grace Hopper and Early Computer Scientists
Grace Hopper (1906-1992)
BS Math/Physics, PhD Math
Enlisted in the Navy during WW2, rising to Rear Admiral
Involved in military computing research
Created the first compiler (a special program) programming and
compiling on the same computer
Popularized machine-independent PL
Helped create COBOL: first high level PL
ASCII
ASCII is a code for representing English characters as numbers, with each
letter assigned a number from 0 to 127. For example, the ASCII code
for uppercase M is 77. Most computers use ASCII codes to represent text,
which makes it possible to transfer datafrom one computer to another.
See chart for conversion
C-Srings
C-strings are null-terminated (marked by \0) arrays of ASCII characters
A = {H, e, l, l, o, \0}
find more resources at oneclass.com
find more resources at oneclass.com
###### You're Reading a Preview

Unlock to view full version

Subscribers Only

#### Loved by over 2.2 million students

Over 90% improved by at least one letter grade.