Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need code for Address Book...

Need code for Address Book...

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpioslearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Ting
    wrote on last edited by
    #1

    Hi. I am trying to finish this code for an address book using a struct. Can someone please correct my code. If anyone wishes to help please run the program and you will see what my problem is. After the user makes an entry (with choice 1), it should be able to display (with choice 2). My display function is not working. I am not doing something right. I need help with that, please, anyone :) ! Also, if the user enters more than one entry, the display function should display these entries one at a time. The user will hit enter to display the next entry. And so forth. Here is my code: const char FILENAME[80] = "C:\\MS Visual C++\\Programs\\AddressBooktest.dat"; struct addresstype { char lastname[21]; char firstname[21]; char line1[31], line2[31], line3[31], line4[31]; char phone[14]; }; int menu(); void add_to_address_book(struct addresstype &); void output_info(struct addresstype &, ofstream &); void input_info(struct addresstype &); void display_address_book(struct addresstype); void main() { struct addresstype addin; int choice=0; ofstream outfile; outfile.open(FILENAME, ios::out); if(outfile.fail()) { cout< 3) { system("cls"); cout<<"\t\t" << "INVALID ENTRY"<>choice; return choice; } void add_to_address_book(addresstype& addin) { system("cls"); cout<

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups