Pointers
Gapfill exercise
Enter your answers in the gaps. When you have entered all the answers, click on the "Check" button.
Define void pointer in C?
Till now, we have studied that the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
assigned to a pointer should be of the same type as specified in the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
declaration. For example, if we declare the int
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
, then this int
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
cannot point to the float
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
or some other
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
of variable, i.e., it can point to only int type variable. To overcome this problem, we use a pointer to void. A pointer to void means a generic pointer that can point to any
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
type. We can assign the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
of any data type to the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
pointer, and a void pointer can be assigned to any type of the pointer without performing any explicit
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
.
Why we use void pointers?
We use
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
pointers because of its reusability. Void
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
can store the object of any type, and we can
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
the object of any type by using the indirection
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
with proper
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
.
Why we use dereferencing pointer?
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
a pointer is used because of the following reasons:
It can be used to access or manipulate the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
stored at the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
location, which is pointed by the pointer.
Any
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
applied to the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
pointer will directly affect the value of the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
that it points to.
What do you mean by Command Line Arguments in C?
The
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
passed from command line are called command
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
arguments. These arguments are handled by
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
() function.
To support
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
line argument, you need to change the
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
of main() function as given below.
int main(int argc, char *argv[] )
Here,
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
counts the number of arguments. It counts the file name as the first argument.
The argv[] contains the total number of arguments. The first
address
argc
argument
arguments
command
data
Dereference
dereferenced
line
main
memory
operation
operator
pointer
pointers
retrieve
structure
type
typecasting
variable
void
is the file name always
Check
OK