can I use a function (written by myself) in writing a new function?
can I use a function (written by myself) in writing a new function?
Yes.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Sure. Is this what you meant:
Obviously, you may make this as complicated as you like, and output it to a file if you like.Code:void func() { printf("void newfunc()\{\n\tprintf(\"Hello, World\\n\");\n}\n"); }
[I know, this is probably NOT what you meant to ask for, but I couldn't resist answering a different one... ]
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
then, I should define which one first?
Doesn't really matter - it's a style issue. If you are only calling one from the other, then I personally prefer to put the outermost (called last) first, and then work in towards main. But I starting programming in Pascal many years ago, and in Pascal you are not meant to forward declare function unless one calls the other recursive manners.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.