Aromin - Act1 Compee

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

DIRECTIVES SYNTAX DESCRIPTION

#define #define multiply( f1, f2 ) ( f1 * f2 The #define creates a macro,


) #define multiply( a1, a2 ) ( a1 * which is the association of an
a2 ) identifier or parameterized
identifier with a token string.
After the macro is defined, the
compiler can substitute the
token string for each
occurrence of the identifier in
the source file.
#elif, #else, #endif, #i #if defined(CREDIT) Parts of a source file are
credit(); compiled under the direction of
#elif defined(DEBIT) the #if directive, together with
debit(); the #elif, #else, and #endif
#else directives. The line group
printerror(); immediately after the #if
#endif directive is retained in the
translation unit if the expression
you specify (after the #if) has a
nonzero value.
#error #if !defined(__cplusplus ) The #error directive emits a
#error C++ compiler required. user-specified error message at
#endif compile time, and then
terminates the compilation.
#ifdef, #ifndef // ifdef_ifndef.CPP The #ifdef and #ifndef preproce
// compile with: /Dtest /c ssor directives have the same
#ifndef test effect as the #if directive when
#define final it's used with the defined
#endif operator

#import #import C++ Specific Used to


"..\drawctl\drawctl.tlb" incorporate information from a
no_namespace type library. The content of the
raw_interfaces_only type library is converted into C+
+ classes, mostly describing the
COM interfaces.
#include #include <stdio.h> Tells the preprocessor to
include the contents of a
specified file at the point where
the directive appears.
#line // line_directive.cpp The #line directive tells the
// Compile by using: cl /W4 preprocessor to set the
/EHsc compiler's reported values for
line_directive.cpp the line number and filename to
#include int main() a given line number and
{ filename.
printf( "This code is on line %d,
in file %s\n", __LINE__,
__FILE__ );
#line 10
printf( "This code is on line %d,
in file %s\n", __LINE__,
__FILE__ );
#line 20 "hello.cpp"
printf( "This code is on line %d,
in file %s\n", __LINE__,
__FILE__ ); printf( "This code is
on line %d, in file %s\n",
__LINE__, __FILE__ );
}

#pragma // some_file.cpp - packing is 8 Pragma directives specify


// ... machine-specific or operating
#pragma pack(push, 1) system-specific compiler
- packing is features. A line that starts with
now 1 #pragma specifies a pragma
// ... directive. The Microsoft-
#pragma pack(pop) – specific __pragma keyword
packing is 8 enables you to code pragma
again directives within macro
// ... definitions. The standard
_Pragma preprocessor
operator, introduced in C99 and
adopted by C++11, is similar.
#undef #define WIDTH 80 Removes (undefines) a name
#define ADD( X, Y ) ((X) + (Y)) previously created with #define
.
.
.
#undef WIDTH
#undef ADD

#using #using file [as_friend] Imports metadata into a


program compiled with /clr.

DIFFERENT DATA TYPES


DATA TYPES SYNTAX SIZE
Integer int 4 Bytes
Character Char 1 Byte
Valueless/Void Void 16-bit (2 Bytes), 32-bit( 4 Bytes),
64-bit(8 Bytes)
Floating point float 4 Bytes
Wide Character wchar_t 2 Bytes
Double floating point Double 8 Bytes
Boolean Variable bool 1 byte

FLOW CHART SYMBOLS

SYMBOL SHAPE FUNCTION


Small circle or Connector When only a piece of the
symbol algorithm is draw

Oval Depicts an entire algorithm.


Start/Begin, Stop/End

Diamond or Decision It indicates a decision needs to


be take

Rectangular or Action Computation, input/output,


assignment, and other
operations.
Input or Output Input/output or same as
rectangular

Predefined Process Symbol Shows named process which is


defined elsewhere.

Off-page connector Used to connect the flowchart


portion on a different page.

Preparation Symbol Preparation step.

Multi-document Symbol Multiple documents.

Flow Lines Specifies the sequence in which


the actions should be carried
out

You might also like