1 / 6

Project 2 Overview

Project 2 Overview. Start Part 1 Today Part 2 handed out later Turn in both by 8/3. New Skills Needed. Working with ASCII Art How to append to an existing file ofstream trans(“transactions.txt”, ios::app); How to jump to one line of file and modify seekg and seekp

Télécharger la présentation

Project 2 Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Project 2 Overview Start Part 1 Today Part 2 handed out later Turn in both by 8/3

  2. New Skills Needed • Working with ASCII Art • How to append to an existing file • ofstream trans(“transactions.txt”, ios::app); • How to jump to one line of file and modify • seekg and seekp • fstream accts("accounts.txt", ios::in | ios::out); • Accessing Date/Time

  3. fstream accts("accounts.txt", ios::in | ios::out); accts.seekg(recordNum*BYTES_PER_REC, ios::beg); accts>>userID>>name>>PIN>>balance; … … accts.seekp(recordNum*BYTES_PER_REC, ios::beg); accts<<userID<<" "<<name<<" "<<PIN<<balance; accts.close(); Using seekg/seekp Formatting removed for clarity (but is very important!)

  4. Working with ASCII Art • Visit www.schnoggo.com/figlet.html • Replace \ with \\

  5. Date and Time char dateStr[9], timeStr[9]; // time and date vars _strdate(dateStr); // dateStr now has date _strtime(timeStr); // timeStr now has time #include<ctime>

More Related