The comp.lang.c++ unofficial IAQ Page.
[ Under Construction ]


This page has been inspired by it's counterpart for comp.lang.c - http://www.plethora.net/~seebs/faqs/c-iaq.html

Any contributions to this page are welcome. Please mail your contributions to jshiva@bigfoot.com .
Make this page grow in Real Time.
Your contributions will be acknowledged.
Click here for the current list of contributors.



Q)What does IAQ mean?
A)Most people think it stands for Infrequently asked questions.
But actually, it means Inept Absurd Questions.


Q)What is a class ?
A)It's something which you obviously didn't attend.
If you had attended, you would probably, not be asking this question here.
Alternate Answer Also, class is something you don't have.

Q)What is an object ?
A)There are various types of objects. For eg. you are an object of pity.
Alternate Answer Typically, we all Object when someone asks questions like these in comp.lang.c++

Q)What is Object Oriented Technology ?
A)It's when you use technology like USENET & EMail to object to questions like these.

Q)How can I prevent other programmers from violating encapsulation by
seeing the private parts of my class?
A)Use crypt to encrypt your source file. Write a wrapper for the compiler,
which will decrypt the source file before compiling it.
[ Alternately, use could use MSWord to encrypt your file with your password
on Windows Platforms ]

Q)Is Encapsulation a Security device?
A)No. However crypt is.

Q)What's the difference between the keywords struct and class?
A)You can write
template<class T>
class Vector {/* */};

However, you cannot write
template<struct T>
class Vector {/* */};

Q)What is a reference?
A)It's a book. If you had one, you wouldn't be asking this question here,
but would be reading it.

Q)What happens if you return a reference?
A)You could do that only if you have borrowed it from somebody, say a lending
library. In that case, many things can happen. For eg. if you return it late,
you may have to pay a fine.

Q)What's the deal with inline functions?
A)They are giving one free with every reference that you buy.

Q)Why should I use inline functions? Why not just use plain old #define
macros?
A)Because #defines are evil. They are processed by the pre-processor. The
compiler never sees them. i.e. they do not add to the no of lines of code
written by you. Whereas if you use inline functions, you can include them in
the number of lines of code written by you. This may make a significant
difference in your status reports, appraisals & job interviews.

Q)Are inline functions guaranteed to make your performance better?
A)No, however they are guaranteed to make your performance appraisal better.

Q)What's the difference between pass-by-value and pass-by-reference?
A)Pass-by-value is usually set at 45%; pass-by-reference is where you
put someone else's name on your exam paper.

Q)What's a compiler?
A)Something that produces test data for decompiler writers.


Q)I can declare an array of int's as
int something[10];
How do I declare an array of floats ?

A)float away[10];


Q) The books Teach Yourself C++ in 10 minutes says
"Do not use inline functions. The compiler is better at optimizing your
code than you think. Avoid using inline functions; let the compiler
make your code run as fast as you can."
Is this true ?

A)The advice is reasonable for the level at which the book is
written. I think there's a consensus in the C++ community that
one should not use inline functions until one has at least 14
minutes experience with the language.


Q) In GUI environments where return values from main aren't
neccessarily meaningfull, is it not better to use void main() ?

A) Maybe. However, some Gurus disagree. They say that it would be
much better to declare it as double main() is such cases & make it return
NaN to indicate that the return value is meaningless.



The original comp.lang.c++ FAQ is maintained by Marshall Cline,
and many of the questions were stolen from it. Some of the idiotic misconceptions here are original.
As a matter of fact, even the above 2 lines are stolen from the CLC IAQ.


List of contributors.
Shiva (yours truly)
Paul S. Ganney
Richard Heathenfield
Michael Rubenstein
Marshall Cline
Chris Engebretson