New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Operating Systems

by: Jamaal Franecki

Operating Systems CS 3100

Jamaal Franecki
Weber State University
GPA 3.7


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 6 page Class Notes was uploaded by Jamaal Franecki on Wednesday October 28, 2015. The Class Notes belongs to CS 3100 at Weber State University taught by Staff in Fall. Since its upload, it has received 59 views. For similar materials see /class/230778/cs-3100-weber-state-university in ComputerScienence at Weber State University.

Similar to CS 3100 at Weber State University

Popular in ComputerScienence


Reviews for Operating Systems


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/28/15
Streams and Files A Review QM C IIO Overview I iosteams were originally created as an example of C class hierarchy but are now a exible and expressive IO system ITables in Lafore gt ios formatting flags p 571 gt Manipulators p 572 gt ios functions p 573 gt istream functions pp 574575 gt ostream functions pp 575576 gt Error status flagsfunctions pp 577578 gt Mode bits for open pp 596597 9 Parameterized Manipulators See page 572 I Declared in iomanip IAlso used with the operatorltlt gt setiosflagsong flags 32 1bit flags gt resetiosflagslong flags 32 1bit flags gt setbaseint base gt setwint width gt setprecisionint precision gt setfillchar fi QM Additional Manipulators Page I Declared in iostream gt noshowbase Indicate base on output eg Ox gt noshowpos Show 39 for positive values gt nouppercase Display A F for hex and E for exponents gt noshowpoint Show decimal point amp trailing zeros gt noskipws Skip white space on input gt left Leftalign pad on right gt right Rightalign pad on left gt internal Pad between signbase and value gt scientific Scientific notation gt fixed Fixed decimal format 9 File IIO File streams I ifstream Constructor opens a le for reading I ofstream Constructor opens a le for writing I Example ifstream inquotdatafilquot if infail cerr ltlt ERROR unable to open file return ofstream outquotresultfilquot if outfail cerr ltlt ERROR unable to open file return QM Open Modes Note flags can be or ed together see pages 596597 I iosin Open for input I iosout Open for output I iosapp Append data to the end ofthe output le I iosate Go to the end ofthe le when opened I iosnocreate Fail ifthe le does not exist I iostrunc Discard contents of existing le I iosbinary Open in binary mode defaults to text mode I iosnoreplace Do not ovenNrite existing le fail open call I Example ifstream inquotdata lquot iosbinary QM Lineoriented Input CStrings I istreamamp getchar buf int size charterm 39n39 gt Reads until term is found upto a max of size1 chars gt Does not read term character I istreamamp getlinechar buf int size charterm 39n39 gt Reads until term is found upto a max of size1 chars gt Also reads but does not store the term character I Overloaded versions of get gt int get gt istreamamp getchar ampc gt istreamamp getstreambufamp stream char term 39n39 I int gcount reports the number of characters read QM Examples Reading files one line or one character at a time ifstream inquotdatatxtquot int 0 char line128 while lineof cout ltlt charinget int c while 0 inget l EOF coutputc char line128 while ingetlineline 128 NULL cout ltlt line ltlt endl Binary IIO aka block or raw O I istreamamp readchar buffer int nbytes gt Reads nbytes directly into buffer gt int gcount reports the number of bytes actually read I istreamamp writechar buffer int nbytes gt Writes nbytes directly from buffer l Example char buffer1024 int count inreadbuffer 1024 while count inputgcount gt 0 outwritebuffer count inreadbuffer 1024 QM IIO Error Handling See pages 577 and 578 I Errorstatus flags gt goodbit no errors no other flags set flags O gt eofbit at end of file gt failbit io operation failed recoverable gt badbit invalid operation recoverable gt hardfail unrecoverable error I Errorstatus operations gt good No problems gt eof At end of file gt fail Operation failed ie formatting but the buffer is okay gt bad An error has occurred and the buffer may be corrupted gt clear Clears the badbit QM Pointer Arithmetic Addition subtraction and comparison IAssumes a contiguous block of memory ie an array I Allowed operations gt Addsubtract an integer tofrom a pointer p1 i i p2 gt Difference between two pointers p2 p1 i of elements gt Test for inequality if p1 p2 if p1 p2 I No check for addressing out of bounds IThe compiler automatically multiplies and divides by the size in bytes ofthe referenced object in pointer arithmetic p5 p2 p1 p p1p2 p5 p 2 p14 p1 p2


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Amaris Trozzo George Washington University

"I made $350 in just two days after posting my first study guide."

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.