Pointers, C/C++ Programming

In this sub-task will you implement three functions for the final three function prototypes that will do exactly the same as the three functions that you have just written. This time, however, you use pekararitmetik. The aim is for you to practice using the pointer, it is not allowed to use the index to perform operations on the array.

Arrays and pointers are very closely related, an array name can be seen as a constant pointer to first element in an array. Array name array thus corresponds to & array [0], ie the address on the first element in the array. Below is an example of how to print all the values in an array by using pekararitmetik.

void print_array (int * pointer, int size)
{
int * p;
for (p = pointer; pi <(pointer + size); p + +)
printf ("% d", * pi);
}

The pointer p is initialized to point to first element in an array. As long as the value of the pointer p is less than the array size increases the value of pi to point to the next element in the array. Print the value of pi points to using the *- operator.

Posted Date: 3/15/2013 5:48:47 AM | Location : United States







Related Discussions:- Pointers, Assignment Help, Ask Question on Pointers, Get Answer, Expert's Help, Pointers Discussions

Write discussion on Pointers
Your posts are moderated
Related Questions
The ability to verify at run time the type of an object by using the typed operator or the dynamic_cast operator.

The video game machines at your local arcade output coupons depending on how well you played the game, you can redeem 10 coupons for a candy bar, 6 coupons for .a medium soft drink

Mathematical Statements and assignments    Within C we can directly load up the variable from within the program using the mathematical expression equates (=) e.g.   a= 'h'

Array types An array is a collection of objects of a one data type. The individual objects are accessed by their position in the array. This way of accessing is known as indexi

Create a function ValueDelta(char inName[], char outName[]) that reads a text file with option specifications and writes the option values as well as Delta. The inName[] file conta

This program requires the use of a windows box, no console applications are allowed. Prepare for Christmas now.  Each year, Reindeer Gift Emporium publishes a Christmas price list

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

processing two jobs through 2 machine

Explain the Bitwise-Inclusive-OR Operator: |? The bitwise-inclusive-OR operator (|) contrast each bit of its first operand to the corresponding bit of its second operand and if

I have a mini project where I need to write a code .wonder if someone can help me.I already have the forms and webmaster page done just need to code portion