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
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Please give me a programming code of first & follow with c or c++ laqnguage .When anyone give me the programming code of first & follow please explain every lines with the help

Overloading Binary Operators class SI {float i,p,n,r,a; public: SI(){}; SI(int gp,int gn, int gr); void putdata(void); SI operator+(SI); }; SI SI::opera

please provide me the assignment help. What is the difference between a copy constructor and an overloaded assignment operator?

What do you mean by a sequential access file? - When writing programs which store and retrieve data in a file, it's possible to designate that file into various forms. - A s

Multiple Inheritance Multiple inheritance , as the name suggests , is  deriving a class from more than one class . The derived class inherits all the properties of all its base c

#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of

Write a program in C to implement a FTP client that can interoperate with a default FTP server . The client should implement basic FTP commands GET PUT LIST DELE . GET -> to

Explain string constants in c language - Escape Sequences? Illustrations are "945", "hello", "well done", "5+3". The character constant (example 'x') isn't equivalent to the st

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci