A pointer in C is the address of a variable or function.
The advantages of a pointer over using normal variables are:
If you pass the pointer to a variable to a function, then that function can modify the value of the variable directly; for example, suppose you want a function to convert a string to lower case. If pointers are not available, then a function call would look like this (in BASIC):
NewString = ToLower("This Is A String")
What the BASIC compiler does is make a copy of the "This Is A String" string, pass it to the ToLower() function and return a copy back to the caller to be copied to NewString.
All these copies make the process slow. In C you can do this:
StringPtr = "This Is A String"
ToLower(StringPtr)
StringPtr points to the string, ToLower() receives the pointer and performs the conversion on the original string without any copying taking place.
Function pointers allow C to be used in a more object orientated way; C doesn't support objects, but a structure can contain a collection of data and function pointers so the structure can effectively contain data and the functions needed to process it.
The danger of pointers is that they point directly into computer memory and its impossible for the compiler to be certain that you haven't made a pointer point outside of the program memory; the way you find out is when the program crashes when run with an exception error.
There is a also slight format error with the way pointers are described in C; for example consider the following function:
int Divide(int *a, int *b)
{
int r;
r = *a/*b;
return r;
}
Although it looks harmless, the compiler can't tell if the /*b; is introducing a comment or is part of the calculation and most compilers will produce a missing close comment message - although some will silently compile the program - but commenting out everything after the *a!
In 8086 programming (MS DOS), a far pointer is normalizedif its offset part is between 0 and 15 (0xF).
C++ is the name of a programming language.
example of procedural programming are those programming language that have structure e.g basic,fortran,c++,c and pascal e.t.c
programming languages B and BCPL which was used to derive C
c++
Logo
It is a pointer which is pointing to present object with which the memberfunction is called in c++ language.
C - programming language - was created in 1972.
It is accessing data by address.
Android is programmed in the C and C++ programming language.
C is a programming language.
C++ is the name of a programming language.
example of procedural programming are those programming language that have structure e.g basic,fortran,c++,c and pascal e.t.c
programming languages B and BCPL which was used to derive C
Download 1000s of C C C++ Programming Language. http://www.guruengineers.com
I am guessing you typed the question wrong, the way I understand your question is "Why is the programming language named C++ and not C ? " The answer to this is that there is a programming language called C, and in that programming language the ++ means increment by one. So C++ is the language C improved, as such it can read and compile all C programs in addition to having other features that C does not have.
A programming language is a language in which a human can tell a machine to do something, three examples include: C, C++ and C#.
PHP is written in the C programming language.