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
#decode the code

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

How would you print the values of the variables words and lines so they appear in the form: There were 6040 words and 680 lines. Here, 6040 and 680 represent the values of the two

A student apears in exam of math, physics, and chemistry. Write a program to find the total marks aa student has aqueired find the average.

Example of structure: struct item {                 int element;                 node_ptr next; }; typedef node_ptr stack; stack create(void) {

Operation on list - c++ program: Write a program in c to Insert value on list and list iteration. typedef struct item *node_ptr; struct item {                   int e

Describe what is actual arguments? - When certain functions are created and used to perform an action on some provided values, some values are required to be passed to them. Th

program to convert string from super ascii string with minimum cost

what is a string?