MAT 21B Lecture Notes - Lecture 18: Entry Point, Null Character

33 views1 pages
School
Department
Course
Professor
Lecture 18
Announcement: study for midterm
Extra office hours
See on canvas for more announcement over weeked
String formatting
- Instead of printing sprint() stores the formatted string in a character array
o Access to same placeholder
o Array must be large enough
o Wont understand if lower than limit size
2D array
- 2d array is complete and stored in one block in memory
o Possibly waste a lot of space
- Function needs to know the number to characters per entry max limit
- Size of each sting is properly evaluated because of explicit null character
Array of pointers
- Array of pointers, pointing on the string
o String can be located anywhere in memory
o Stored in memory C
o Strings are just the right size
Follows the character limit
Command lines (argument)
- Argc contains the number of command line argument
o Including name
o Argv is array of pointers to strings, for each argument
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 1 pages and 3 million more documents.

Already have an account? Log in
beigecamel74 and 41 others unlocked
MAT 21B Full Course Notes
83
MAT 21B Full Course Notes
Verified Note
83 documents

Document Summary

See on canvas for more announcement over weeked. Instead of printing sprint() stores the formatted string in a character array: access to same placeholder, array must be large enough, wont understand if lower than limit size. 2d array is complete and stored in one block in memory: possibly waste a lot of space. Function needs to know the number to characters per entry max limit. Size of each sting is properly evaluated because of explicit null character. Array of pointers, pointing on the string: string can be located anywhere in memory, stored in memory c, strings are just the right size, follows the character limit.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents