I have some question about C++

It' not homework...Sorry if I made it sound like that...

Can a void function return any value?

Can a void function not be used in an output statement?

Can a void function be used in an assignment?

In a function with call-by-reference parameters, will any changes to the formal parameters change the actual arguments passed to the function?

In a function with call-by-reference parameters, are the values of the actual arguments are passed to the function?

What should a all-by-reference be used?

What does the post condition of a function do?
Last edited on
closed account (1yR4jE8b)
I was just about to post all of the answers to this, then I realized that these sound an awful lot like homework questions, so....

No dice.
There not these are questions that I have, I'm just want some yes or no's so I can understand it...
In a function with call-by-reference parameters, will any changes to the formal parameters change the actual arguments passed to the function?

This question is the one that gives it away. Anyone who correctly makes the distinction between "formal parameters" and "arguments" would likely know the answers to these questions. It might not be homework but it's safe to assume they aren't your own questions.

Read your textbook (or at least work on your search engine skills--these questions are answered all over the place).
Last edited on
closed account (1yR4jE8b)
haha, moorecm, that question you pointed out was the exact one that I realized what was going on ;-P good call.

Mostly because, until I took a course on programming language design I had no idea there were specific terms for 'formal parameters' and 'actual arguments'.

If you want some help, post what you already think are the answers and we may be more inclined to help you understand.
This:

If you want some help, post what you already think are the answers and we may be more inclined to help you understand.


Can a void function return any value?

Try compiling this :

void test()
{
return 10;
}



Can a void function not be used in an output statement?

Not sure what this means ?


Can a void function be used in an assignment?

See (1)

In a function with call-by-reference parameters, will any changes to the formal parameters change the actual arguments passed to the function?


void test( int &x)
{
x = 33;

}

Try calling this function




In a function with call-by-reference parameters, are the values of the actual arguments are passed to the function?

What should a all-by-reference be used?
What does the post condition of a function do?

Not sure what these mean...

For most part you can answer these questions by writing small examples. You can use an ide/compiler like code::blocks to set one up.
Topic archived. No new replies allowed.