Log In Register

Units


Initialization Of Pointer Arrays - Questions and Answers

 

Practice these Initialization Of Pointer Arrays under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Initialization Of Pointer Arrays for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Initialization Of Pointer Arrays of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Initialization Of Pointer Arrays.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Initialization Of Pointer Arrays under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Initialization Of Pointer Arrays topic of C Programming:

 

1.

An array of strings can be initialized by:

Answer: Option D

Explanation:

2.

To declare a 3 dimension array using pointers, which of the following is the correct syntax:

Answer: Option C

Explanation:

3.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int i = 0, j = 1;
  5.         int *a[] = {&i, &j};
  6.         printf("%d", *a[0]);
  7.         return 0;
  8.     }

Answer: Option D

Explanation:

4.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char *a[10] = {"hi", "hello", "how"};
  5.         printf("%d\n", sizeof(a[1]));
  6.     }

Answer: Option C

Explanation:

5.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char *a[10] = {"hi", "hello", "how"};
  5.         int i = 0, j = 0;
  6.         a[0] = "hey";
  7.         for (i = 0;i < 10; i++)
  8.         printf("%s\n", a[i]);
  9.     }

Answer: Option B

Explanation:

6.

Comment on the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         char *a = {"p", "r", "o", "g", "r", "a", "m"};
  5.         printf("%s", a);
  6.     }

Answer: Option D

Explanation:

7.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int i = 0, j = 1;
  5.         int *a[] = {&i, &j};
  6.         printf("%d", (*a)[0]);
  7.         return 0;
  8.     }

Answer: Option B

Explanation:

8.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         char *p[1] = {"hello"};
  5.         printf("%s", (p)[0]);
  6.         return 0;
  7.     }

Answer: Option A

Explanation:

9.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char *a[10] = {"hi", "hello", "how"};
  5.         int i = 0;
  6.         for (i = 0;i < 10; i++)
  7.         printf("%s", *(a[i]));
  8.     }

Answer: Option B

Explanation:

10.

Which of the following are generated from char pointer?

Answer: Option D

Explanation:

11.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         char **p = {"hello", "hi", "bye"};
  5.         printf("%s", (p)[0]);
  6.         return 0;
  7.     }

Answer: Option C

Explanation:

12.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         int i = 0, j = 1;
  5.         int *a[] = {&i, &j};
  6.         printf("%d", (*a)[1]);
  7.         return 0;
  8.     }

Answer: Option A

Explanation:

13.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char *a[10] = {"hi", "hello", "how"};
  5.         int i = 0;
  6.         for (i = 0;i < 10; i++)
  7.         printf("%s", a[i]);
  8.     }

Answer: Option A

Explanation:

14.

Which of the following declaration are illegal?

Answer: Option C

Explanation:

15.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         char *a[10] = {"hi", "hello", "how"};
  5.         printf("%d\n", sizeof(a));
  6.     }

Answer: Option A

Explanation: