[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Interview Questions and Answers :: Hewlett Packard Enterprise

4. Find out the mistake done in below program, and fix it.

void array-init(int *arr)
{
arr = malloc (4*sizeof (int));
arr[1] = 10;
arr[0] = 20;

}

int main()
{
int *p = NULL;
array-init(p);
printf("%d", p[0]);
printf("%d", p[1]);
return 1;
}

Answer:

No Discussion on this question yet!

Post Your Answer Here:      Public      Private

No Discussion on this question yet!