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
advantages of lfu

Develop a regular expression for (i) Integer (ii) Real number (i) A regular expression for integer is [+ | -] (d)+ (ii) A regular expression for real number is [+

Describe in brief about The internet Web sites need to be set up to maximise information supplied to customers and to ensure they are as self-contained and helpful as possible.

Result extends to functions - perceptrons: Thus the dotted lines can be seen as the threshold in perceptrons: whether the weighted sum, S, falls below it, after then the perce

Q. Explain about Parity bit? Parity bit is an error detection bit added to binary data such that it creates total number of 1's in the data either odd or even. For illustration

Q. Benefits of traditional hard disks and CD-ROM? CD-ROM is suitable for distribution of large amounts of data to a large number of users. CD-ROMs are a general medium these da

Q. Find simplified function F and implement that function using only NAND gates. 1. F(A,B,C) = (A+B) (A'+B+C') (A'+B'+C') 2. F (A,B,C) = A'B'C'+B'CD'+A'BCD'+AB'C' 3. F(X,Y

Decision Trees: Visualize you only ever do four things at the weekend such as go shopping or watch a movie or play tennis and just stay in. In such case what you do depends on

Q. Example of Input a Single Digit? Input a Single Digit for example (0,1, 2, 3, 4, 5, 6, 7, 8, 9)  CODE SEGMENT   ... ; Read a single digit in BL register with ech

Define Overflow.  An overflow is a problem in digital computer due to the width of registers is finite. A result that contains n+ 1 bit cannot be accommodated in a register wit