Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

make the main program send the original number back to function

$
0
0
hi. im not sure how the main program will send the original telephone number in my program to a second function. the first function just reads in the telephone number and the second function
breakoriginalnumber
breaks the number into three parts and print them. this is what the output should look like from this function:
(718) 343-3243      is the  original number
718 is the area code         343 is the exchange      3243 is the extension 


this is my main function and the first function:
int main()
{
    string telephone[14];
    int i = 0;
    
    while (cin) {
        i++;
        readoriginalnumber (telephone[i]);
        cout<< endl;
        
    }
    return 0;
}

void readoriginalnumber (string &) {
    string telephone[14];
    int i = 0;
    
    cout<< "Enter your telephone number" << endl; 
    getline (cin, telephone[i]);
    return;
}


all i know right now is that my breakoriginalnumber gets three reference parameters. thank you for your help.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>