struct customer *p= malloc( sizeof( struct customer ) ); Given the sample allocation for the pointer "p" found above, which one of the following statements is used to reallocate ptr to be an array of 10 elements?

  1. p = realloc( ptr, 10 * sizeof( struct ritesh));

  2. realloc( ptr, 9 * sizeof( struct ritesh) );

  3. p+= malloc( 9 * sizeof( struct ritesh) );

  4. p = realloc( ptr, 9 * sizeof( struct ritesh) );


Correct Option: A

Find more quizzes: