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

Describe about general-purpose registers, Q. Describe about general-purpose...

Q. Describe about general-purpose registers? The general-purpose registers as the name proposes can be used for several functions. For illustration they may comprise operands o

Difference between next and continue clause, The difference among the next ...

The difference among the next and continue verb is that in the continue verb it is used for a situation where there is no EOF condition that is the records are to be accessed again

Explain essential properties of distributed operating system, Describe the ...

Describe the essential properties of the Distributed Operating System Essential properties of Distributed operating systems: Sharing resources Calculation speed-up

What is the mips assembly code, Question: (a) Using an appropriate dia...

Question: (a) Using an appropriate diagram, illustrate the structure of an instruction used for branching purposes and state the purpose of each part. (b) Given the number

Explain isdn address structure and its working, Draw the ISDN address struc...

Draw the ISDN address structure and explain how the addressing works? Address Structure: The ISDN address structure is demonstrated in figure. ISDN number part has a maximum

What is the session, What is the session.  Session is a collection of v...

What is the session.  Session is a collection of various groups of method. Every session is assigned to a single control terminal. This terminal is either a pseudo-device. or a

Lifo under perpetual inventory procedure, Q. LIFO under perpetual inventory...

Q. LIFO under perpetual inventory procedure? LIFO under perpetual inventory procedure observes Exhibit to see the LIFO method using perpetual inventory procedure. In this proce

What does the logo mean, This comes at the complication time, If we give th...

This comes at the complication time, If we give the LOGO option to the compiler, it take a bitmap file (i.e., ) as logo previous to loading the Application.

Illustration to demonstrate design of sequential circuits, Q. Illustration ...

Q. Illustration to demonstrate design of sequential circuits? Let us take an illustration to demonstrate above process. Suppose we want to design 2-bit binary counter employing

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