arguments

Started by
3 comments, last by ukdeveloper 18 years, 8 months ago
what exactly is an argument in C++?
Advertisement
Arguments are the things in the parenthesis after a function's name in a function call. So in:
sin(2.4)


2.4 is the argument to sin().
oh, why do u need them?
Read over this.
Quote:Original post by Avont29
oh, why do u need them?


It allows you to pass parameters into a function.

Parameters are basically items that you "give" to a function to allow it to work.

Somebody else will have a much better explanation, but you can have a function that adds two numbers together, and you can call the function and pass in the two numbers to be added as parameters.

It keeps your code cleaner in the long run, I find.

This topic is closed to new replies.

Advertisement