[prog] Re: C++

Sue Stones suzo at spin.net.au
Sat Mar 13 20:19:04 EST 2004


On Sat, 13 Mar 2004 04:53 pm, wolf wrote:
> Hello : )
> Thank you for helping : )
> Since getdata() and putdata() are of type void would the correct
> response
> between the braces be:
>
> getdata()
> {
> return getdata;
> }
>
> I'm afraid I don't understand this bit at all:
> > showdata()
> > {
> > // use loop with EOF
> > // to extract data and display it
> > }
>
> how to extract something from type void?
> again thank you for helping : )
>
You can't return info from a void function.  "void" means that it doesn't 
return anything.  If you want data to use you change it so that it has an 
apropriate type.  However the fuctions as they are now read form standard 
input, and wrire to standard output so for the time being leave them as they 
are.  

I suggest you don't worry about this yet.  First get the object working then 
worry about what you are going to do with them.  You will get further doing 
this in lots of little steps rather than trying to solve all the world 
problems all at onece.

sue


More information about the Programming mailing list