Passing a pointer to an int array using a c function

I have a very simple question.

What is wrong with this challenge?

int params[2] = {1, 1};
return strcmp95((char*)buffer1, (char*)buffer2, (long)stringLength, &params);

The function is defined as follows:

double  strcmp95(char *ying, char *yang, long y_length, int *ind_c[])

{...

When I compile in Xcode, I get the following warning:

warning: passing argument 4 of 'strcmp95' from an incompatible pointer Type

Sorry for the inaccuracy. Here is the function description:

/ * Arguments: ying and yang are pointers to 2 lines for comparison. Lines do not have to be null-terminated because the length is passed. y_length is the length of the lines. ind_c is an array that is used to determine whether certain parameters should be activated. A small value indicates that the option is deactivated.
    :      ind_c [0] ,     . . ,     .      ind_c [1] . , "" , case string "CODE". .         , . */

+3
5

params int [2], int * , , int [], int * . , ¶ms int(*)[2], int *, int ** ( , int *[] ).

- :

double  strcmp95(char *ying, char *yang, long y_length, int *ind_c)

, int[2]. int(*)[2] - 2 int s:

double  strcmp95(char *ying, char *yang, long y_length, int (*ind_c)[2])

, int , int , . :

double  strcmp95(char *ying, char *yang, long y_length, int *ind_c, size_t len)

size_t - , , , len ((sizeof params / sizeof params[0]), / , 2, ). .

, y_length size_t. long , -1. unsigned long, , long (, , long ).

+4

strcmp95 int (int **), ints (int (*)[2]).

strcmp95 , :

double  strcmp95(char *ying, char *yang, long y_length, int (*ind_c)[] );

, (int (*x)[]) ( int *(x[]) int *x[])

+2

, strcmp95 int, , int . - , ...

double  strcmp95(char *ying, char *yang, long y_length, int *ind_c[])

... ...

double  strcmp95(char *ying, char *yang, long y_length, int *ind_c)

... , ...

double  strcmp95(char *ying, char *yang, long y_length, int ind_c[])
+1

& params, params , .

return strcmp95((char*)buffer1, (char*)buffer2, (long)stringLength, params);

-, strcmp95 int, :

double  strcmp95(char *ying, char *yang, long y_length, int ind_c[])
+1

, params ( ), strncmp95 i.e int * ind_c [].

+1

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


All Articles