|
-
June 13th, 2012, 07:13 AM
#3
Re: Difference between function and macro
 Originally Posted by Yarlini Amirthanesan
Hello expects. Can you tell me wot is the difference between a function and macro in C++. They lok the sam. Can you tell? When you use a macro and not a function?
Email: [email protected]
No: From the call alone, it is not possible to know if you are using a macro, a function, or an object's operator().
However, there is a very widespread coding practice that says that macros should be in ALL_CAPS:
Code:
DO_SOMETHING(); //Probably a macro
do_something(); //Probably a function
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|