#define is a pre-compiler directive which is used to define a macro. All occurrences of the defined macro within your source code are replaced by the macro definition prior to compilation. In other words, your code is altered to produce an intermediate file which is actually compiled, just as if you'd copy/pasted the macro definition throughout your code. However, the end result is that the compiler cannot identify any problems within your macros since they will no longer exist in the intermediate file. Macros are not type safe, thus they are generally frowned upon, especially when they are used to define complex functions. However, correct usage of macros can greatly simplify your code and ultimately permit the compiler to build different versions of your code, depending upon which definitions you define. For instance, you will typically use slightly different versions of some functions depending on whether you are building a debug or release version of your code, and will typically #define DEBUG for debug builds. You can also cater for cross-platform coding by filtering platform-specific functions using macro definitions. You alter the type of the build simply by defining the appropriate definitions, either within the code itself (using #define), or via the compiler's pre-processing command line switches, or a makefile script.
The # symbol defines pre-processor instructions. For example:
#include name_of_header.hpp;
tells the processor that the program will include a header which is externally written.
Another example is:
#define NameOfStructure name_of;
This means that, where I would have declared something 'NameOfStructure,' I can now use 'name_of' instead.
This example is a typedef which allows the declaration of a given data variable/type to be given a different name, and allows (but is not limited to) excessively long names to be shortened, but keeps the code self documenting.
all preprocessor directives start with #(hash) symbol in both c & c++
just as you do it in C.
Sure.
Use the C++ getline() function from the standard library.
Nothing.
all preprocessor directives start with #(hash) symbol in both c & c++
ANSWERThe reasons to use hashing in C are the same as in any language. A hash value is used to reduce a value from a complex form into a simpler form, to simplify operations such as searches.
How the turbo c plus plus use what in the computer.
just as you do it in C.
Only if you have a C++ compiler.
depends what you use it for. c++ = object oriented c = not object oriented
Use "typedef" : both in C and C++.
To use C++ in Netbeans you will need a C++ compiler.
Sure.
Programming language.
In C and in C++, the ++ operator means to increment. C++ was intended to be the next version, i.e. the incremental next step, of C, hence the use of the ++ operator.
Use the C++ getline() function from the standard library.