Pointer issues in c

A quick question about programming in C. I did not take this course, but read online about pointers and various notation used. Does the next line call an array of 10 pointers to integers or a pointer to an array of 10 integers?

int *x[10];

Does the following result also execute in a function that takes a double input and returns a pointer to a character?

char (*f) (double a);

Thanks in advance!

Edit: enter the first line of code incorrectly.

+4
source share
2 answers

A function that takes a double input and returns a pointer charwill look like this:

char * foo(double arg);

arg - , foo - , char * - , char.

char (*foo)(double arg);

, (arg) char.


. ...

int * array[10];

10 , int *, int .

int (*array)[10];

int 10.

+7

int *x[10]; , x - 10 , int.

char (*f) (double a); , f , char double.

+2

Source: https://habr.com/ru/post/1537988/


All Articles