Bifalgorithm post · Computer science one · Organizing Functions

How do you call functions in C?

How do you call functions in C? (Computer science one · Organizing Functions) — "18.1.4. Calling Functions Once a function has been defined, or at least a prot…

Ideas in this flowchart

  • Appel de fonctions
  • La fonction doit être définie ou son prototype doit être accessible.
  • Pour appeler une fonction, on écrit son nom suivi de parenthèses.
  • Les parenthèses contiennent les valeurs ou les variables transmises.
  • Les arguments peuvent être des variables.
  • Exemple : sum(a, b) reçoit a et b, puis c contient 30.
  • Les arguments peuvent être des valeurs littérales.
  • Exemple : getDistance(0.0, 0.0, 10.0, 20.0) utilise des valeurs littérales.
  • Un appel peut aussi combiner différents types d’arguments.
Feed/

How do you call functions in C?

No cover

Channel

Computer science one

1 page

"18.1.4. Calling Functions Once a function has been defined, or at least a prototype has been brought into scope via an #include statement, you can write code to call your function(s). The syntax for doing so is to simply provide the function name followed by parentheses containing values or variables to pass to the function. Some examples: 1 int a = 10, b = 20; 2 int c = sum(a, b); //c contains the value 30 3 4 //invoke a function with literal values: 5 double dist = getDistance(0.0, 0.0, 10.0, 20.0); 6 7 //invoke a function with a combination: 8 double p = 1500.0;"

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.