written questions ....guide

hoping people can help each other with written questions on c++,provide answers etc.
int f(int x) {
if (x < 0) {
x = -x;
}
return fac(x);
}

can any help me by telling what this code will output.
thanks
Nope, for three reasons.

1) We don't just give out homework answers;
2) You didn't provide the code for fac();
3) You could just type this in, add a main(), call f() and see what it returns.
its not homework.....im studyin 4 an exam and i want 2 know d answer
Read #2 and #3.
Since I take it jsmith defined all these as pointers, I'll just slip in a reinterpret_cast and see what we get... ah, yes.

1) We don't just give out effortless answers to anything, except MAYBE in the Articles section where people are expressly forbidden from asking questions except as part of an article;

Reason why: it doesn't help you learn.

-Albatross
Last edited on
Topic archived. No new replies allowed.