How a pointer variable declared in c, Computer Engineering

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''.

 

Posted Date: 6/14/2013 7:06:57 AM | Location : United States







Related Discussions:- How a pointer variable declared in c, Assignment Help, Ask Question on How a pointer variable declared in c, Get Answer, Expert's Help, How a pointer variable declared in c Discussions

Write discussion on How a pointer variable declared in c
Your posts are moderated
Related Questions
The Peripheral interface chip system requires the construction of the interface chip circuit, which is controlled by main micro-controller via the user interface. I also need set

Explain the use of SSL to secure the network.  SSL (Secure Sockets Layer) is a protocol developed by Netscape for transferring private documents by the Internet. SSL works by u

Q. Illustrate working of T Flip-Flop? T (Toggle) flip-flop is attained from JK flip-flop by combining inputs J and K together. The implementation of T flip-flop is displayed in

What is the role of IR and PC?  Instruction Register (IR) having the instruction being implemented. Its output is available to the control circuits, which make the timing signa

What is priority interrupt? A priority interrupt is an interrupt that establishes a priority over the various sources to verify which condition is to be serviced first when two

The Environment variable SCRIPT_NAME in CGI script specifies? In CGI script gives the path of URL after server name.

What is sensitivity list? A list of signals which trigger execution of the block when they change value. Sensitivity list  indicates that when a change occurs to any one of

What is link destruction? Link destruction is inverse of link creation. When a link is destroyed makes sure the associated objects accessible by other handles or intentionally

Difference between data warehousing and data mining The difference between data warehousing and data mining is that data warehousing shows to the data storage while data mining

Is there a way to apply the same formatting to every  sheet in a workbook in Excel? Ans)  Yes. To do this, you will require to right click on one of the worksheet tabs and th