,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Nimbus Sans L"; font-size:x-small } -->
ahmm hi everyone i'm a newbie here at daniweb.. but i have an unfinished business(project).. guys.. pls.. help me to solve this.. or give some comments or replies in my problem..

this is my problem.. i don't know what function/s should i use to compare all the chars on all the lines of my database.. ahmmm.. i want the program output will be like this..


Enter the Country Code: AF(ex.) // in my program if you type US afghanistan is always a reply statement..

Afghanistan: Movistar, Digicel (ex. telephone operators)

THIS IS MY CODE (hope u help me to solve my problem..:


using namespace std;
int main()
    char code[3];
    char whole[600];
    char who[300][300];
    cout << "\n\n\tType the Country Code: \t\t ";
    cin >> code;
    FILE *f;    
    f=fopen("countrycode.csv", "r");
    if(f==0) cout<< "SORRY can't find or open the file";
//char *u=strstr (whole, "-");
            int a=0, i;
//if (u==0)
//char delimeter[]="-\"";
//char who[300][300];
                char *huj=strtok(whole, "-\"");
                    if(++a >= sizeof who/ sizeof *who)break;
                    huj=strtok(NULL, "-\"");
            //for (i=0; i<a; i++)
                //int i, b=EOF;    
                //while (i<b);    
                //while (fgets(whole, 900,f)!=NULL)
                        cout /*<< "if:"*/<<who[1]<<endl;
                    {    strcmp(who[0],code);
                        cout /*<<"else:"*/<<who[1];//<< " "<<code<<endl;
                        //cout << "INVALID!!!";
        //cout << "while  loop: " <<whole << endl;

return 0;


and that is my program code.. the database is save as .csv file format.. ahmm please give me some advice..

At my database is look like this

AF - Afghanistan: (telephone operators)
AX - Aland Island: (not yet found its telephone operator)
US - United States: Digicel, Movistar, Us Phone Company...etc..


and this is my program hope that i finish this project as soon as possible.. thnks.. God Bless!

we have already gone over this problem here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.