How a pointer variable declared in c, Computer Engineering

Assignment Help:

How a pointer variable declared in C ? Why is it sometimes desirable to pass a pointer to a function as an argument?

A pointer is a variable which contains the address in memory of another variable. We can have a pointer to any variable type.

To declare a pointer to a variable do:

int *ip;

This declaration looks like our earlier declarations, with one obvious difference: that asterisk. The asterisk means that ip, the variable we're declaring, is not of type int, but rather of type pointer-to-int. (Another way of looking at it is that *ip, which as we'll see is the value pointed to by ip, will be an int.)

The unary or monadic operator & gives the ''address of a variable''.

The indirection or dereference operator * gives the ''contents of an object pointed to by a pointer''.

 


Related Discussions:- How a pointer variable declared in c

What is program-controlled i/o, What is program-controlled I/O? In prog...

What is program-controlled I/O? In program controlled I/O the processor repeatedly checks a status flags to achieve the needed synchronization among the processor and an input

Explian two limitations of dead-box analysis, (a) Explian two limitations o...

(a) Explian two limitations of dead-box analysis. (b) Describe why memory analysis is difficult. (c) With reference to the "Shadow Walker" rootkit, explain what is meant by

Economic argument for good design, One way of demonstrating the importance ...

One way of demonstrating the importance of good ID is by showing tangible benefits that can be talked about in cash terms. Within a business, good ID can lead to benefits such as h

Eliminating hazards - computer architecture, Eliminating hazards of pipeli...

Eliminating hazards of pipeline -  computer architecture: We can delegate the work of eliminating data dependencies to the compiler, which can fill up in suitable number of NO

How do you classify the neutrons, Q. How do you classify the neutrons in te...

Q. How do you classify the neutrons in terms of its kinetic energy? Neutrons are classified as-per to their kinetic energy as (a) Slow neutrons as well as (b) fast neutrons.

Pvm communication model, Q. PVM communication model? A nonblocking rece...

Q. PVM communication model? A nonblocking receive as soon as returns with either data or a flag that data hasn't arrived while a blocking receive returns only when data is in r

Instruction queue in bus interface unit, Q. Instruction Queue in Bus Interf...

Q. Instruction Queue in Bus Interface Unit? Instruction queue is employed to store the instruction ‘bytes' fetched. Please conceren two points here: that it's (1) A Byte (2) Qu

An example of the subscriber traffic in erlangs, A subscriber makes three p...

A subscriber makes three phone calls of 3 minutes, 4 minutes and 2 minutes duration in a one hour period. Calculate the subscriber traffic in erlangs, CCS and CM. Subscriber tr

Processing elements (pes) -array processing, Processing elements (PEs)  : E...

Processing elements (PEs)  : Every processing element consists of ALU, local memory and its registers  for storage of distributed data. This PEs has been interconnected via an inte

Benefits of having densely packed integrated circuits, What are benefits of...

What are benefits of having densely packed Integrated Circuits? These are stated below: Reliability: The integrated circuit interconnections are in fact more reliable

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd