Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Passer une fonction comme argument d'une autre fonction???

Featured Replies

Posté(e)
  • Auteur

Tu as dejà codé en c++, parce que c'est tout sauf ce que tu viens de dire: il faut passer par des pointeurs

Posté(e)

Tout comme le nom d'un tableau est <<un pointeur sur ce tableau>>, le langage C considère que le nom d'une fonction est <<un pointeur sur cette fonction>>.

L'utilisation d'un pointeur sur une fonction permet de la passer comme argument à une autre fonction. Juste un exemple, soit la fonction:

double integration (double (*f)(), double a, double b)

/* */

/* but: integrer f entre a et b */

/* f est un pointeur sur une fonction */

/* qui retourne un double */

{

...

for (.. ;.. ;..)

x=x+ (*f) (a+k*h); /* appel de la fonction */

... /* passee en argument */

...

}

Il suffit de passer à integration le nom d'une fonction:

...

/* prototype de la fonction cosinus */

double cos(double x);

...

/* cos est un pointeur sur une fonction */

x=integration (cos, zero, pi_sur_2);

... */

:chinois::google::love:

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.