#include<stdio.h>
#include<conio.h>
int highest(int *ptr,const int row,const int col);
void main()
{
int *ptr;
int temp[3][4]={3,4,2,6,5,8,9,12,0,4,7,10};
ptr=&temp[0][0];
printf("%d",highest(ptr,3,4));
getch();
}
int highest( int *ptr,const int row,const int col)
{
int h=0;
for(int i=0;i<row;i++)
for(int j=0;j<col;j++)
if(*(ptr+i*col+j)> h)
h=*(ptr+i*col+j);
return h;
}
NOTE: here *(ptr+i*col+j)=temp[i][j].
program finds the highest value element of 3x4 array.
Lucky Club: Live Dealer Casino Site & Promotions
ReplyDeleteLucky Club is an online casino where you can experience the best in live casino games from the best of 카지노사이트luckclub the best providers from all over the world.