CMPT 127 Lecture Notes - Lecture 7: Newline, Gnu Compiler Collection, C Mathematical Functions

36 views5 pages

Document Summary

There are two new things on line 9. The function scanf() is roughly the inverse of printf(), reading text from standard input, a text stream directly analogous to standard output but in the other direction. Text from the shell is delivered to a program"s standard input (stdin for short) and is queued there until the program chooses to read it. The shell program and the computer"s operating system work together to make this happen. We will see later that this simple scheme can be very powerful. The arguments to scanf() are a format string, similar to that of printf(), which is a template to be matched against the input. The format string specifiers (starting %) indicate that the text in this place in the input string should be interpreted as a specific type, and stored in the variable indicated by the next argument.

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