P
pandapower
Hi,
These were some of the interview questions asked,can someone discuss
whats the solution.
1.I have a singly linked list and i have to print the 5th element from
the last.I have to print it in a single pass of the linked list.How do
i print that?
2.If i have a structure, whose elements are an integer,a character and
a character pointer.What will be the size of the structure.Suppose on
the specified platform the alignment is on 4 byte boundaries. where
does the alignment come into picture and why ? How is padding related
to alignment for structures.
3.Suppose i have a
int **ptr ;
How do i initilize this so that iam able to access it like a two
dimentional array.
and conversely if i have something like
int arr[6][7];
int *ptr;
what can i do so that i can assign it like this
ptr = arr;
please feel free to give any comments/suggestions
regards
rohitash
These were some of the interview questions asked,can someone discuss
whats the solution.
1.I have a singly linked list and i have to print the 5th element from
the last.I have to print it in a single pass of the linked list.How do
i print that?
2.If i have a structure, whose elements are an integer,a character and
a character pointer.What will be the size of the structure.Suppose on
the specified platform the alignment is on 4 byte boundaries. where
does the alignment come into picture and why ? How is padding related
to alignment for structures.
3.Suppose i have a
int **ptr ;
How do i initilize this so that iam able to access it like a two
dimentional array.
and conversely if i have something like
int arr[6][7];
int *ptr;
what can i do so that i can assign it like this
ptr = arr;
please feel free to give any comments/suggestions
regards
rohitash