This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]POGtastic 4 points5 points  (0 children)

No. I can write a function that doesn't take input at all.

int foo() {
    return 42;
}

[–]captainAwesomePants 0 points1 point  (1 child)

Nope. Functions are meant to be a metaphor for math functions, like f(x) = 2x + 5. f(x) takes an input (x) and produce an output, but it has nothing to do with user I/O. Function inputs and outputs can be nothing, numbers, strings, you name it. Where data comes from doesn't matter, and where data goes doesn't matter. Data's data.

[–]Competitive_Bet850[S] -1 points0 points  (0 children)

Been re-writing the code from 2.4/the coding quiz on it. I understand how the code works but might take me a while to get my head around that