Interview Question
Software Engineer / DevelopersIf a 2-d array is declared and it is a row major then, the memory will be allocated in a continuous manner... ex:char a[2][2] is allocated in a sequential order like,
if a=0xf341
(0xf341)=a[0][0]
(0xf342)=a[0][1]
(0xf343)=a[1][0]
(0xf344)=a[1][1]
so just
char* convert(char a[][n])
{
return a;
}
- Anonymous February 11, 2011