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

What is the purpose of DOTNET? Dot Net Is a collection of products like C#, ASp.Net, Vb.Net, XML. The purpose of .Net is that we can simply upgrade and degrade our programs whi

Question: (a) Program instructions and data are brought into memory first, in order to be executed. Explain how the CPU enables an instruction to be executed? (b) Describe

Sequential Logic Gates SR flip flop                                                                                                                    1)

Analysis of Algorithms For this task, each student should do two things: An empirical analysis of the runtime and comparisons made for all algorithms as a function of input si

Power point presentation Arrange a 20 minutes power point presentation showing the original and processed filters.  Discuss the methods used for processing and comment on each r

What are the Advantagesof fact finding - Analyst obtains reliable data - It's possible to see exactly what is being done -  This is an inexpensive method in comparison o

Procedure Level Here, parallelism is accessible in the form of parallel executable procedures. In this situation, the design of the algorithm plays a main role. For example eac

Explain the Executing Requests Using a Message-Passing Architecture Executing requests using a message-passing architecture requires good fundamental client-server programming

How optimization is achieved in DNS? Two primary optimizations used in DNS and they are: replication and caching. All root servers is replicated; various copies of the server