You know If you Send the Address of the Varible
that is Accepting the information that would 
minimize memory usage.  

NOTE: You will have to write directly to it.

--- In [email protected], Paul Herring <pauljherr...@...> wrote:
> > //the recursive type
> > void ask_stuId(){
> >        string userInput;
> >        cout<<"Enter your full student Id"<<endl;
> >        getline(cin,userInput);
> >        if(isMatch_strFormat(userInput,"aaa/####/###"))
> >            stuId=userInput;
> >        else {
> >            cout<<"In correct format, ";
> >            ask_stuId();
> 
> Bad, and certainly not efficient compared to your loop version.
> The user could just keep entering rubbish, and each time they do, 
> some more memory is taken up to store the next invocation of the 
> function.


Reply via email to