A question in C language, I hope the master will answer it, and I am grateful

Updated on educate 2024-03-16
6 answers
  1. Anonymous users2024-02-06

    This question is not difficult, and it is easy to understand the pointers.

    First of all, px and py are the addresses of x,y respectively, and when you call the fun function, you pass the address of x,y, so the a,b in the subfunction is actually the address of x,y in the main function, so *a,*b is actually the value of x,y in the main function, so the operation on *a,*b is equivalent to the operation on x,y.

    With this in mind, the procedure is straightforward. Three formulas: *a=*a+*a; w=*a;*a=*b;*b=w;After the sequence is executed, *a (i.e., x in the main function) becomes, and *b (i.e., y in the main function) becomes.

    Answered. In addition, it is recommended to have a good understanding of the meaning and function of the pointer.

  2. Anonymous users2024-02-05

    #include

    void fun (float *a ,float *b )float w ;

    a=*a+*a; w=*a;*a=*b;*b=w;

    main()

    fun (px,py);

    printf("%,%",x,y);

    There are a few mistakes you wrote, help you fix it, in fact, it's just a commutative function, just add a pointer and an addition. First, pass the values of x and y to the fun() function, a=x=2, b=y=3, a adds once to 4, and b does not change. Swap a and b for x=3 and y=4

    That's the general idea.

  3. Anonymous users2024-02-04

    ||Simply for you.

    Bai a few of it. You du

    Just study hard.

    1。You can think of dao as 5 ||a=b+c)==3) 。First of all, you have to have a clear idea, ||This one.

    Weigh something, this is the most basic operation, either left or right is true, the result is true, and this expression only returns true, false can also be considered 1, 0. For the number 5, the result of a non-0 number is true, regardless of what is on the right, this result must be true or 1

    2。This needs to clarify the memory occupied bytes of the int, at present, the int in the CPU is 4 bytes, according to your answer, the int should be 2 bytes. char is 1 byte.

    3。First of all, know the difference between i++ and ++i. i++ is to use i after i is adding 1, ++i is i first adding 1 and then using, that is, i first adds 1, and then assigns a value to m, then i is 7, m is, that is, j is assigned to m first, and then 1 is added, then n=9, j=10

  4. Anonymous users2024-02-03

    1d 2a 3a

    5a 1×5 | x <-5

    30 (d expression forced truncation false).

    Hello (string).

    7 9 0 (no conditions are built on the front).

  5. Anonymous users2024-02-02

    One, two, three, 1Error 2Error 3Correct 4Correct 5Mistake.

  6. Anonymous users2024-02-01

    1.Variable name.

    2.A comma expression, whose value takes the last term. 78 5 = 15 (decimal part do not do) 3Select a,-- x is equivalent to x=x-1;

    Remainder operation. Formatting control", [Output Parameter 1,..

    scanf("Formatting control", [input parameter 1,..6.No topic.

Related questions
4 answers2024-03-16

It's not very hard that the tail node next points to null. >>>More

8 answers2024-03-16

Reads characters and counts to'\0'Come to an end!

18 answers2024-03-16

Solution: 1) 0 < x < = 50

After mobilizing x farmers to engage in vegetable processing, the total annual income of farmers engaged in vegetable planting should be (100-x)*3*(1+2x%), and it should not be lower than the total annual income of farmers engaged in vegetable planting before mobilization, that is, (100-x)*3*(1+2x%) = 300 >>>More

6 answers2024-03-16

1.Vector ac=(-2,-2,1), vector bc=(-1,1,0), the product of vector ac and vector bc = (-2)*(1)+(2)*1+1*0=0, so ac bc >>>More

7 answers2024-03-16

Note: This analysis is based on:

1,(from is a read-only property of public, sort has 17 overloaded methods, clone method inherits from object and is also defined in the array class, and copyto also has two overloads. So let's look at the length this way. >>>More