Friday 29 November 2013

C Program to Add Two Matrices Using Pointers


  The C Program given with this post finds the sum of two matrices using pointers.
The prototype of function addmat is shown below.

 int (*addmat(int (*p)[MAX], int (*q)[MAX]))[MAX];

The function addmat accepts two pointers to one dimensional arrays with size MAX as arguments and returns a pointer to a one dimensional array with size MAX.

Figure Below Shows a Sample Output


No comments:

Post a Comment