Hi, is it possible to put this part of my program in a single function?
I would like it to be within a function it would make my main only consist of functions
The thing I'm not sure about is that there is a lot of variables so if I made it a void function would I have to define everything in the function prototype(I think its called prototype you know its the heading. Thanks much.
Maybe just the control of selection part on second thoughts. But still there is a lot there how would I handle all the variables just define everything in the function heading?
So in c++ its OK that there are functions within a function? You know above I have a printaddress function and so forth if you look at the cases. So my question is I would just put those in the heading of the function like a variable? If that is I was to make the control of selection chunck of code into a function?
Sorry I just get confused because of the functions that are being used by that switch and I think to myself ... " how to I take care of that?" Thanks.
Yeah there can be function inside the function. You can call a function inside another code. For example, if we rewrite you code, it will be similar like this
Oh thats cool. Thanks a lot sir. Yes it is more clear but I always have questions ha. I see what is going on but I do not need to define any of the functions in the heading? That is the only thing that is confusing. It just works that way because I already wrote the functions seperatly so calling it in the function is no different then If I called it in main? Also I have a question about loops really quick ...
What happens if you have a loop and it is say like ..
int number=0;
cin number;
while(number<2)
{
cout<< HI<<end;
}
int number=0;
cin number;
while(number<2)
{
cout<< HI<<end;
}
Ok what is happens if I have number in the loop once more versus if I have it just outside of the loop like the second example?