Re: [algogeeks] Puzzle

2011-08-04 Thread Abhinav Arora
@Nikhil : This question was asked to 2 people during Adobe interview on Tuesdaythe above solutions are perfectly alright. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

[algogeeks] Re: C output 2

2011-07-27 Thread Abhinav Arora
No it will not cause a memory leak as its a string literal and it behaves more like a read only entity. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] Re: OUTPUT

2011-07-27 Thread Abhinav Arora
I believe the method written is incorrect, it didnt work for me i guess this is the right way...worked for me: int **p; p=malloc(3*sizeof(int *)); -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] Re: OUTPUT

2011-07-27 Thread Abhinav Arora
Look we wish to allocate memory for an array of 3 integer pointers. so when we do dynamic allocation we always store the result in a pointer to the required data type. for example if you wish to dynamically allocate int arr[3[] u will write : int *p=malloc(3*sizeof(int)); So now when you do it

[algogeeks] Re: sizeof() question.

2011-07-27 Thread Abhinav Arora
The *sizeof* operator cannot be used with the following operands: - Functions. (However, *sizeof* can be applied to pointers to functions.) - Bit fields. - Undefined classes. - The type *void*. - Dynamically allocated arrays. - External arrays. - Incomplete types. -

[algogeeks] Re: direct i ..ques

2011-07-27 Thread Abhinav Arora
It will be (1+2+3+,,,+n)^2.u can verify it for a chess board hich will have 1296 rectangles for n=8 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit