some where i read that funtions are predifined code,, so my question is "what is code (excluding funtions)
^.^
some where i read that funtions are predifined code,, so my question is "what is code (excluding funtions)
^.^
The woundeful Joseph Goss,,,
e-mail me "[email protected]"
if you want
Ermmm,,... hello anyone there?
i am 15
I'd define functions as code that manipulates data (assuming you accept that operators are shorthand for functions). functions may be predefined, as in the standard libraries, or user defined.
Code is a combination of variables, which hold data to be manipulated, functions, that do the manipulation, and control loops, that determine how often and when to do the manipulation. Of course there are many details like braces, keywords, function prototypes, preprocessor directives, namespaces and other things as well, but variables, functions, and control loops are the basic functional components of code, IMO.
FOLDOC is a nice resource.
Since I learned BASIC before I learned C++, I think of functions sort-of like BASIC sub-routines. A function diverts program-flow... The program goes-off and runs the function, and then returns to where it came from... perhaps returning a value to the main (or other calling) function.
Essentially all code in C++ is in functions... main() is a function.
Personally, I'd say that the header functions that come with your compiler and other library functions are predefined... I wouldn't consider the functions I write predefined (unless I had previously created my own library.)
Last edited by DougDbug; 11-14-2003 at 01:47 PM.