Help change the program, C program pointer search for d, replace d output with

Updated on technology 2024-04-05
11 answers
  1. Anonymous users2024-02-07

    Guess it's a certain eggache teacher asking for a pointer or an array of pointers, right?

    It's changed a lot.,The landlord looks at it.。

    #include ""

    #define empty 0

    void find_all(char *,char**,char);

    void main()

    int i;

    char string="oh! day after day.";

    char * ptr[30];

    printf("%s",string);

    find_all(string, ptr, 'd');

    for(i=0;ptr[i]!=empty;i++)ptr[i]='*';

    printf("%s",string);

    void find_all(char *s,char** ptr, char d)

    int i,j;

    for (i=0,j=0;*s!='\0'&&j<30;s++)if(*s==d)

    ptr[j++]=s;

    ptr[j] = empty;

  2. Anonymous users2024-02-06

    void good 1(int f,int b){} can be ignored.

    Your function is written incorrectly, and your function arguments are passed in a value transfer mode and no value is returned, so your function is an invalid function. No matter how you use it, it won't affect the outside variables. (At most, there is a delay of a few microseconds.)

  3. Anonymous users2024-02-05

    int *g,*k; good_1(*g,*k);This is wrong、、When you pass the argument to the form argument, the data type must always be 、、、 to think that the address is being passed、、、

  4. Anonymous users2024-02-04

    It's impossible to get the effect you want with value passing.

  5. Anonymous users2024-02-03

    You have defined an array of character pointers, and each element in the array is a pointer variable of type char, so the biggest problem with this program should be.

    p+i) = a;

    Replace with *p[i] = a;

    That's the main problem. Hope it helps.

  6. Anonymous users2024-02-02

    p is a pointer to an array, so move 256 elements at a time, so wrong.

    Declaring *p[256] is an array of pointers, and there are no syntax errors.

  7. Anonymous users2024-02-01

    The result of the first problem is indeterminate because p is a p and the initial values k, i are not given

    p[3]ababc, g3

  8. Anonymous users2024-01-31

    14 Second, are you sure you didn't make a mistake? If it's *p+1, it's 13, 14, 13

    m,kc=c+3

    ababc,g3

  9. Anonymous users2024-01-30

    14,1

    m,k in the third question you didn't write the option, give a possible *p='d'+1 or c[1]='e';

    ababc,g3

  10. Anonymous users2024-01-29

    The outcome of the first question is uncertain.

    The result of the second question is m,k;

    The result of the third question is ababc, g, 3

  11. Anonymous users2024-01-28

    for(n=0;n<6;n++,c++,d++)c=*d;

    At the time of the above statement, the value of c has been moved backwards (C++ sentence) for a total of 6 times.

    So to printf("%s",c);c, c is no longer equal to a.

Related questions
5 answers2024-04-05

Program debugging is the process of testing the compiled program by manual or compiling the program to correct syntax errors and logical errors before putting it into actual operation. This is an indispensable step to ensure the correctness of computer information systems. After the computer program is written, it must be sent to the computer for testing. >>>More

14 answers2024-04-05

1, the woman's eight characters are 癸ugly Yichou 壬申 癸卯 Now Wuchen Universiade; The man's eight characters are Jiayin Jiaxu Yiyou Gengchen Now Bingzi is lucky, and the time is wrong upstairs. >>>More

7 answers2024-04-05

C language does not round, if you want to round it, such as a to keep two decimal places: >>>More

7 answers2024-04-05

Pick up tutorials online. I can't tell. `

11 answers2024-04-05

1.Cleanser-toner-eye cream, essence-lotion, cream-sunscreen-followed steps such as applying foundation and makeup. >>>More