#include<stdio.h>
#include<conio.h>
void** printA( int*  , int ,int[][]);
void printw(void*, int ,int);
void main()
{

int num[3][5] = {
{1, 2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
};

int* num_ptr[3];
void** ptr;
printf("traversing by double pointer");
ptr=printA(*num_ptr,3, num);
printw(* ptr, 3, 5);
}
void** printA(int* num_ptr[],int r,int num)
{
   int i,j;
   for(i=0;i<r;i++)
   {
      *num_ptr[i]=num[i][0];

   }
   return ** arrp[0];
}

void printw(void * ptr, int r, int c)
{
   int i,j;
   for(j=0;j<r;j++)
   {
      for(i=0;i<c;i++)
      {
         printf("%d",(int)**ptr[j]);
         *ptr++;
      }
   }
}
Salem commented: Come back when you've learnt to read the forum RULES -4

Recommended Answers

All 2 Replies

i think the going rate for homework dumps is $1000.00 USD, paypal verified.

hi all...I am actually trying to retrieve a 2 Dimensional array, by passing it to a function, which returns a pointer to the array.
I want to print the array using pointers only....

#include<stdio.h>
#include<conio.h>
void** printA( int*  , int ,int[][]);
void printw(void*, int ,int);
void main()
{

int num[3][5] = {
{1, 2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
};

int* num_ptr[3];
void** ptr;
printf("traversing by double pointer");
ptr=printA(*num_ptr,3, num);
printw(* ptr, 3, 5);
}
void** printA(int* num_ptr[],int r,int num)
{
   int i,j;
   for(i=0;i<r;i++)
   {
      *num_ptr[i]=num[i][0];

   }
   return ** arrp[0];
}

void printw(void * ptr, int r, int c)
{
   int i,j;
   for(j=0;j<r;j++)
   {
      for(i=0;i<c;i++)
      {
         printf("%d",(int)**ptr[j]);
         *ptr++;
      }
   }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.