Kumkum (@quarsh-panaka-27)

quarsh-panaka-27's cover image
Powered by FIFO
quarsh-panaka-27's image

Kumkum

User doesn't have a description

Followers3
Following1
Spaces0

Assigning any pointer type to a void pointer without using a cast is allowed in both C and ANSI C. In ANSI C we can also assign a void pointer to a non-void pointer without using a cast to non void pointer type. This is not allowed in C ++.

The type void normally used for: 1) To specify the return type of function when it is not returning any value. 2) To indicate an empty argument list to a function.

Both C and C++ compilers support all the built in types. With the exception of void the basic datatypes may have several modifiers preceding them to serve the needs of various situations. The modifiers signed, unsigned, long and short may applied to character and integer basic data types. However the modifier long may also be applied to double.

IDENTIFIERS: Identifiers refers to the name of variable , functions, array, class etc. created by programmer. Each language has its own rule for naming the identifiers. The following rules are common for both C and C++.

C++ KEYWORDS: Asm double new switch Auto else operator template Break enum private this Case extern protected throw

KEYWORDS: The keywords implement specific C++ language feature. They are explicitly reserved identifiers and can’t be used as names for the program variables or other user defined program elements. The keywords not found in ANSI C are shown in red letter.

3

TOKENS: The smallest individual units in program are known as tokens. C++ has the following tokens. i. Keywords ii. Identifiers iii. Constants iv. Strings v. Operators

3

STRUCTURE OF C++ PROGRAM  Include files  Class declaration  Class functions, definition  Main function program

2

Let us add an additional instruction to our first program: // my second program in C++ #include <iostream> using namespace std;

All in just one line and this would have had exactly the same meaning as the previous code. In C++, the separation between statements is specified with an ending semicolon (;) at the end of each one, so the separation in different code lines does not matter at all for this purpose.