char* my_array[3]; /* an array of three pointers to char */
char* a[3]; char* b[3]; char[3] *c; void(*d)(int*); Note that these are definitions. To make these declarations only, use the keyword 'extern'.
char * p[3];
char c[3]; //array of 3 chars char * p; //pointer of type char p=c; //point the pointer to the base of char array
Please ask just one question at a time!Question 1:How do you declare an array of three pointers to chars?How do you declare an array of three char pointers?Note: both of these questions are merely alternative wordings for the same question.Answer 1:char * a[3];Question 2:How do you declare a pointer to an array of three chars?Answer 2:char a[3]; // an array of three charschar * p = a; // a pointer to an array of three charsQuestion 3:How do you declare a pointer to a function which receives an int pointer?Answer 3:#include // some functions we can point at:void func_1(int * p){}void func_2(int * p){}// note: all functions we wish to point at with the same// pointer must have the same signature.int main(){int* p = NULL; // instantiate an int pointervoid (*pFunc) (int*); // declare a function pointerpFunc = func_1; // point to func_1pFunc(p); // call func_1 via function pointerpFunc = func_2; // point to func_2pFunc(p); // call func_2 via function pointerreturn(0);}Note that the brackets in the function pointer declaration are required. If you omit them, you will end up with a standard function declaration that returns a pointer to void, resulting in a compiler error.
int main() { char *array[3]; // This declares an array of type char*of size 3 // Declare two random chars char example0 = 'X'; char example1 = 'Y'; // You can use the char* array elements just like any regular char* array[0] = example0; array[1] = example1; printf("array[0] = %c, array[1] = %c\n", array[0], array[1]); // Prints X, Y array[0] = example1; array[1] = example0; printf("array[0] = %c, array[1] = %c\n", array[0], array[1]); // Prints Y, X return 0; }
char *p[3];
typedef float (*pt_func)(int, int); pt_func arr[3];another way:float (*pt_func[3])(int, int);
typedef float (*pt_func)(int, int); pt_func arr[3];another way:float (*pt_func[3])(int, int);
You point at the array the same way you would with an array of any pointer type, by using an additional level of indirection than is employed by the pointers in the array itself. In this case, the array contains pointer-to-function data types (with one level of indirection), thus you must use a pointer-to-pointer-to-function data type (with two levels of indirection) in order to point at the array itself. Had the array contained pointer-to-pointer-to-function data types (where each pointer points to a separate array of pointer-to-function data types), then you'd use three levels of indirection, and so on. You increase the level of indirection by placing an additional asterisk before the pointer's name when you declare the pointer. That is, one asterisk per level.
he made about 130,000 three pointers
3 two-pointers or 2 three-pointers
three ways, two pointers,three pointers andfoul shots