Aspire Faculty ID #13647 · Topic: JAMIA MILLIA ISLAMIA MCA 2023 · Just now
JAMIA MILLIA ISLAMIA MCA 2023

Consider the following C language declarations & statements. Which statement is erroneous? float f1 = 9.9; float f2 = 66; const float *ptrF1; float * const ptrF2 = &f2; ptrF1 = &f1; ptrF2++; ptrF1++;

Solution

- `const float *ptrF1;` → pointer to constant float, can move pointer, not modify value. - `float * const ptrF2 = &f2;` → constant pointer to float, cannot change address, but can modify value. - Statement `ptrF2++` tries to move a **constant pointer**, which is **not allowed**. Hence, `ptrF2++` is **erroneous**.

Previous 10 Questions — JAMIA MILLIA ISLAMIA MCA 2023

Nearest first

Next 10 Questions — JAMIA MILLIA ISLAMIA MCA 2023

Ascending by ID
Ask Your Question or Put Your Review.

loading...