How can i assign a two dimensional array into other temporary two dimensional array.....?? in C Programming..

Posted by AGeek on Stack Overflow See other posts from Stack Overflow or by AGeek
Published on 2011-01-09T05:26:02Z Indexed on 2011/01/09 5:53 UTC
Read the original article Hit count: 229

Filed under:

Hi I am trying to store the contents of two dimensional array into a temporary array.... How is it possible... I don't want looping over here, as it would add an extra overhead.. Any pointer notation would be good.

struct bucket
{
   int nStrings;       
   char strings[MAXSTRINGS][MAXWORDLENGTH];
};

void func()
{
   char **tArray;
   int tLenArray = 0;
   for(i=0; i<TOTBUCKETS-1; i++)
   {
      if(buck[i].nStrings != 0)
      {
         tArray = buck[i].strings;
         tLenArray = buck[i].nStrings;
      }
   }
}

The error here i am getting is:-
[others@centos htdocs]$ gcc lexorder.c
lexorder.c: In function âlexSortingâ:
lexorder.c:40: warning: assignment from incompatible pointer type

Please let me know if this needs some more explanaition...

© Stack Overflow or respective owner

Related posts about c