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

Define hit ratio, Define Hit ratio. The performance of cache memory is ...

Define Hit ratio. The performance of cache memory is frequently measured in terms of quantity called hit ratio. Hit-Find a word in cache. Miss-Word is not found in cache.

What is the difference among thread and process, Thread is a least unit of ...

Thread is a least unit of process. In process have one or more thread.

What are sections, Layout pages, can describe sections, which can then be o...

Layout pages, can describe sections, which can then be overridden by particular views making use of the layout. Major and overriding sections is optional.

Define syntax of mpi_scatter function, Q. Define syntax of MPI_Scatter func...

Q. Define syntax of MPI_Scatter function? MPI_Scatter(Sendaddr, Scount, Sdatatype, Receiveaddr, Rcount, Rdatatype, Rank, Comm): 'Using this function process with rank' ran

State about the indirect addressing, Indirect addressing A memory locat...

Indirect addressing A memory location is given that holds another memory location. This second memory location holds the real data. This mechanism solves problems caused by rea

Student, Suppose we have an array-based list A[0..N - 1] and we want to del...

Suppose we have an array-based list A[0..N - 1] and we want to delete all duplicates. LastPosition is initially N - 1, but gets smaller as elements are deleted. Consider the pseudo

Units of artificial neural networks, Units of artificial neural networks: ...

Units of artificial neural networks: However the input units simply output the value that was input to them from the example to be propagated. So every other unit in a network

Explain about the data logging, Data logging  This technique involves ...

Data logging  This technique involves collecting data automatically using sensors; frequently used when doing scientific experiments or monitoring a system.

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