I meant "g++ -o address address.cpp" ---------- Forwarded message ---------- Date: Wed, 16 Jan 2002 19:52:29 -0500 (EST) From: rmann@xxxxxxxxx To: speakup at braille.uwo.ca Subject: Re: Telephone / Address directory program? Hi. I've attached a simple program to store People's addresses. To compile it, do "gcc -o address address.cpp". On Wed, 16 Jan 2002, Raul A. Gallegos wrote: > Georgina said the following on Wed, Jan 16, 2002 at 11:23:02PM +0000: > > Hi > > Howdy. > > > I wondered if there were any handy terminal programs for storing telephone numbers and addresses. While I've been playing with postgresql, I don't know variations of the select statements well enough for this simple task. It feels like using a sledge hammer for a very small nut. I'm just looking for a small program that I as a single user can enter names, addresses and telephone numbers and retrieve quite easily. Any ideas? > > > I don't remember which distro you use but there is a Debian package > which I use and works quite well. If you don't use Debian I'm sure you > can find it from freshmeat.net and install it manually. > > Package: abook > Priority: optional > Section: mail > Installed-Size: 176 > Maintainer: Alan Ford <alan at whirlnet.co.uk> > Architecture: i386 > Version: 0.4.14-1 > Depends: libc6 (>= 2.2.3-7), libncurses5 (>= 5.2.20010310-1) > Filename: pool/main/a/abook/abook_0.4.14-1_i386.deb > Size: 34556 > MD5sum: 39683e77a3ad53bcd551865b82c5e7c5 > Description: A text-based ncurses address book application. > abook is a text-based ncurses address book application. It provides > many > different fields of user info. abook is designed for use with mutt, but > can be used independently. > > _______________________________________________ > Speakup mailing list > Speakup at braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup > -------------- next part -------------- #include <iostream.h> #include <fstream.h>//header file for file IO int main() { char name[30]; char address[30]; char city[30]; char state[3]; char zip[6]; char phone[13]; int cont = 1; ofstream outfile; outfile.open("address.txt", ios::app); if(outfile) { while(cont != 0) { cout << "Enter the person's name.\n"; cin.get(name, 30); cin.ignore(80, '\n'); cout << "Enter the person's address.\n"; cin.get(address, 30); cin.ignore(80, '\n'); cout << "Enter the city.\n"; cin.get(city, 30); cin.ignore(80, '\n'); cout << "Enter the two letter state abreviation.\n"; cin.get(state, 3); cin.ignore(80, '\n'); cout << "Enter the postal code.\n"; cin.get(zip, 6); cin.ignore(80, '\n'); cout << "Enter the phone number.\n"; cin.get(phone, 13); cin.ignore(80, '\n'); outfile << name << "\n"; outfile << address << "\n"; outfile << city << "\n"; outfile << state << ","; outfile << zip << "\n"; outfile << phone << "\n"; cout << "To quit this program type 0 then return.\n"; cout << "Type return to continue.\n"; cin >> cont; } } else { cout << "Their was an error opening the file.\n"; } outfile.close(); return 0; }