I call funtion but it didn't print any word
<p>I am writing a c++ code.<br>
In this code, I call the function GetOption() first, but it appear nothing.<br>
Can anyone help me?<br>
Other functions have other purpose, but I'm not sure whether it will affect it. Thus I paste it all!<br>
Below is my code:</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;iomanip&gt;
#include&lt;fstream&gt;
#include&lt;boost/regex.hpp&gt;
#include"ContactRec.h"
using namespace std;
using namespace boost;
int GetOption();
int main(){GetOption();}
ContactRec GetContactInfo()
{
    ContactRec id;
    ofstream myoutfile("directory.txt",ios::app); 
    regex reg_email("^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$");
    regex reg_tel("^\\(?(\\d{3})\\)?-?(\\d{3})-(\\d{4})$"); 

        cout&lt;&lt;"enter your name."&lt;&lt;endl;
        cin.ignore(1024,'\n');
        getline(cin,id.Name);

        cout&lt;&lt;"enter your email."&lt;&lt;endl;
        cin&gt;&gt;id.Email;
        while (regex_match(id.Email,reg_email)==0)
        {
            cout&lt;&lt;"data wrong!!!!!!"&lt;&lt;endl;
            cin&gt;&gt;id.Email;
        }
        cout&lt;&lt;"enter your telephone numbers. EX:012-111-1111"&lt;&lt;endl;
        cin&gt;&gt;id.Phone;
        while(regex_match(id.Phone,reg_tel)==0)
        {
            cout&lt;&lt;"data wrong!"&lt;&lt;endl;
            cin&gt;&gt;id.Phone;
        }
        cout&lt;&lt;"Please enter the type(0)Family,(1)Friend,(2)Other"&lt;&lt;endl;
        int p;
        cin&gt;&gt;p;
        id.Type=(ContactType)p;
        myoutfile&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;id.Name;
        myoutfile&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;id.Email;
        myoutfile&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;id.Phone;
        myoutfile&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;id.Type&lt;&lt;endl;
        myoutfile.close();
    return id;
}
void PrintContactInfo(int type)
{   
    ContactRec person;

        ifstream myinfile;
        myinfile.open("directory.txt",ios::in);
        cout&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;"name";
        cout&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;"email";
        cout&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;"telephone";
        cout&lt;&lt;setiosflags(ios::left)&lt;&lt;setw(30)&lt;&lt;"type"&lt;&lt;endl;

    string temp;
    if (type==-1)
    {
        while (myinfile)
        {
            getline(myinfile,temp);
            cout&lt;&lt;temp&lt;&lt;endl;

        }
    }
    else if(type==0)
    {
        while (myinfile)
        {
            getline(myinfile,temp);
            if (temp[70]=='0')
                cout&lt;&lt;temp&lt;&lt;endl;

        }
    }
    else if(type==1)
    {
        while (myinfile)
        {
            getline(myinfile,temp);
            if (temp[70]=='1') 
                cout&lt;&lt;temp&lt;&lt;endl;

        }
    }   
    myinfile.close();
}
int GetOption()
{
    int number=0;
    while(number!=5)
    {
        cout&lt;&lt;"(1)Add a new record"&lt;&lt;endl;
        cout&lt;&lt;"(2)Display the all contacts."&lt;&lt;endl;
        cout&lt;&lt;"(3)Display the contacts of family. "&lt;&lt;endl;
        cout&lt;&lt;"(4)Display the contacts of friends."&lt;&lt;endl;
        cout&lt;&lt;"(5)Exit."&lt;&lt;endl;
        cin&gt;&gt;number;
        if (number==1)
        GetContactInfo();
        if (number==2)
        PrintContactInfo(-1);
        if (number==3)
        PrintContactInfo(0);
        if (number==4)
        PrintContactInfo(1);

    }
}
</code></pre>

<p>Below is ContactRec.h <br> </p>

<pre><code>#include &lt;string&gt;
#include"ContactType.h"
using namespace std;
struct ContactRec
    {
    string Name;
    string Phone;
    string Email;
    ContactType Type;
};
ostream&amp; operator&lt;&lt;(ostream&amp; out,const ContactRec id)
{
    out&lt;&lt;id.Name;
    out&lt;&lt;id.Email;
    out&lt;&lt;id.Phone;
    out&lt;&lt;id.Type;
 }
</code></pre>

<p>Below is ContactType.h</p>

<pre><code>enum ContactType{Family,Friend,Other};
</code></pre>

<p>thanks!</p>
