User Profile

Collapse

Profile Sidebar

Collapse
kouty
kouty
Last Activity: Nov 29 '19, 01:01 PM
Joined: Nov 7 '19
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • kouty
    replied to type of argument in printf function
    in C
    I reached it!

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    //Compiler version gcc  6.3.0
    int swaps(int *num1, int *num2);
    int main()
    { 
      int card;
      printf("How many elements?\n");
      scanf("%d", &card);
      printf("The length of the array will be %d\n", card);
      int numbers[card];
      int *num = NULL;
      num
    ...
    See more | Go to post
    Last edited by kouty; Nov 17 '19, 07:08 AM. Reason: using pointer

    Leave a comment:


  • kouty
    started a topic type of argument in printf function
    in C

    type of argument in printf function

    I am trying to use swaps function and to initiate steps for a bubble sort. In the line 17 I tried to write `printf("%d", &nombre);`. and `printf("%d", nombre);` which respectively leed to the following warning, pasted after the snippet.


    I cannot understand how to write the argument in the printf function. Can someone help me?






    Code:
      #include <stdio.h>
    ...
    See more | Go to post

  • I begin to understand. How can I see the control flow? It seems that the control flow works differently in JavaScript for instance, in which the place of the variable is not relevant. I will relearn about local variable.
    See more | Go to post

    Leave a comment:


  • @dev7060, first, tanks so much for answering.

    There is a pointer called `int(*op[4])(int num1, int num2)`.

    the final step of the program is to output the variable, not pointer, called `op[chif](num1, num2)`, when num1, num2 and chif are reached by the inputs `scanf("%d%d", &num1, &num2)` and `scanf("%d", &chif)`.

    Now, for the final step, I can write `printf("le reultat...
    See more | Go to post

    Leave a comment:


  • Why the place of an variable on the script makes it a pointer or a simple variable.

    Hi, I am learning c language and want to understand a behavior of the language regarding where to inplement variables.




    Code:
    #include <stdio.h>
    
    //Compiler version gcc  6.3.0
    /*On declare 4 fonctions*/
    int ad (int num1, int num2);
    int sub (int num1, int num2);
    int mul (int num1, int num2);
    int div (int num1, int num2);
    
    int main()
    ...
    See more | Go to post
    Last edited by kouty; Nov 8 '19, 09:16 AM. Reason: typo, clarity
No activity results to display
Show More
Working...