Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

the use and adv of usin pointers - need explanation

Status
Not open for further replies.

thecall

Junior Member level 2
Joined
Mar 4, 2007
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,448
Help !!!! Pointers

what is the use and adv of usin pointers while wee do the same work without pointers also..... plz help ....i know to work with pointers but couldnt know its significanse. plz give detail if possible
 

Re: Help !!!! Pointers

This is a vast subject, To explain the power and elegance that pointers bring to the C programming language would take a book or two.
The only way to discover this is to write code and more code. You will then discover that sometimes, using pointers, you can achieve in two lines of code what would take ten lines of code to do without them!
 

Help !!!! Pointers

Pointers access memory locations directly, so execution of the program will be fast. This is however not felt for small programs. For large programs, efficiency can be felt.
 

Re: Help !!!! Pointers

Pointers Advantage :


1.
When u know that u need to give the full array of data to any function ...u can't go for gving the full values of the array to that function .... so what we do is taht we give the base address of that array using either pointer or by just mentioning the array name ...

2.
when you need to share some memory between two systems you have to use a share pointer ....

3.
It gives you the direct access to the memory and its data ....

etc.....
 

Re: Help !!!! Pointers

well, thecall

Pointers are being used for the following reasons:

1- to return more than one value from a function.

2- to pass arrays and strings more conveniently from one function to another.

3-to manipulate arrays more easily by moving pointers to them(or a part of them), instead of moving the arrays themselves.

4- to create data structures, such as linked lists and binary trees, where one data structure must contain references to other data structures.

5- to communicate information about memory, as in the function malloc(), which returns the location of free memory by using a pointer.

from the book:

C Programming using Turbo C++
The Waite Group


hope this benefits you.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top