How do I declare a pointer to an array?

Answer Posted / chittaranjan

int (*ptr)[10];
is the proper declaration of pointer to an array, i.e. ptr
is a pointer to an array of 10 integers .

Note:
int *ptr[10];
which would make ptr the name of an array of 10 pointers to
type int.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are comments included during the compilation stage and placed in the EXE file as well?

679


How can I dynamically allocate arrays?

602


Can static variables be declared in a header file?

623


What are the string functions? List some string functions available in c.

614


How can I use a preprocessorif expression to ?

612






Which is better between malloc and calloc?

678


What is typedf?

675


How many levels of pointers can you have?

712


What is memory leak in c?

640


How can I do serial ("comm") port I/O?

701


Are there constructors in c?

603


What are the 5 types of organizational structures?

557


Explain the difference between #include "..." And #include <...> In c?

636


Write a program to print ASCII code for a given digit.

695


What is meant by gets in c?

613