ok im stuck here atm...what im trying to do is to have the program compile to run in windows..and i have to type in the name...and the program goes into the database and finds the address and puts it onto the screen...just like an address book..

So heres my code..anyone have some advice or tips?
:mrgreen:

#include <map> 
#include <string>
#include <iostream>
using namespace std;

int main() 
{
    map<string,string> addressbook;
    pair<string,string> p1("Eric","415 East Arlington");
    addressbook.insert(p1);
    
typedef pair<string,string> entry;
    map<string,string>::iterator iter;
    cout << "What is Eric's address?" << endl;
    cout << "" << addressbook["Eric"] << endl;
    cout << endl;

    char response;
    std::cin >> response;
    return 0;

}

does it work the way it is intended? If yes, then why fix something that ain't broken? But its obvous that it doesn't do what you want it to do.

What kind of database are you supposed to use? MySql, MS-Access, simple flat-text file? or something else?

does it work the way it is intended? If yes, then why fix something that ain't broken? But its obvous that it doesn't do what you want it to do.

What kind of database are you supposed to use? MySql, MS-Access, simple flat-text file? or something else?

well what i mean is that the code does work...im just trying to convert it to a address book sorta like.....

u have to type in the name and it finds the there address and pops it up under the name.....sorta like basic...

If im not clear then idk :rolleyes:

how do you want to store the data -- or do you want to type evetything in each time you run the program?

Use a loop so that you can enter more than one name/address pair during the same instance of the program.

after asking for Eric's address, use a variable and cin to get the address from the keyboard.

how do you want to store the data -- or do you want to type evetything in each time you run the program?

Use a loop so that you can enter more than one name/address pair during the same instance of the program.

after asking for Eric's address, use a variable and cin to get the address from the keyboard.

was thinking about storeing it the first time...and thanks for the tips man...it really helps alot :D

This article has been dead for over six months. Start a new discussion instead.