Elamur Dictionary

func

English · noun

Senses

Sense 1 · noun · corpus

corpus

A name chosen for a function, a named piece of computer code that performs a task.

Source: Mova's open texts. Licence: cc-by-sa-4.0.

Forms and counts

Noun

  • Forms: func (Number: Sing); funcs (Number: Plur).
  • Seen 2 times in Mova's corpus index.

Usage and labels

corpus

In these C code examples, func names a function that takes two whole-number inputs, n and m.

Examples

3 source examples.

  • int func(int n, int m) { // Caution: checks should be made to ensure n * m * sizeof(float) does NOT exceed limitations for auto VLAs and is within available size of stack. float p[n][m]; // auto VLA is held on the stack, and sized when the function is invoked for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { p[i][j] = i + j; } } print_array(n, m, p); // no need to free(p) since it will disappear when the function exits, along with the rest of the stack frame return 1; } — Wikipedia: C (programming language) (Wikipedia contributors). Licence: cc-by-sa-4.0. — Mova's open texts (cc-by-sa-4.0)
  • int func(int n, int m) { float (*p)[n][m] = malloc(sizeof *p); if (p == NULL) { return -1; } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { (*p)[i][j] = i + j; } } print_array(n, m, p); free(p); return 1; } And here is a similar implementation using C99's Auto VLA feature: — Wikipedia: C (programming language) (Wikipedia contributors). Licence: cc-by-sa-4.0. — Mova's open texts (cc-by-sa-4.0)
  • int func(int n, int m) { float (*p)[n][m] = malloc(sizeof *p); if (p == NULL) { return -1; } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { (*p)[i][j] = i + j; } } print_array(n, m, p); free(p); return 1; } And here is a similar implementation using C99's Auto VLA feature: — Wikipedia: C (programming language) (Wikipedia contributors). Licence: cc-by-sa-4.0. — an example found by Mova's corpus index (cc-by-sa-4.0)

Notes and derived forms

corpus

Sources

Mova's open texts. Licence: cc-by-sa-4.0.

Mova's word records: counts from Mova's corpus index, word lists from Wiktionary and Mova's concept inventory. Licence: cc-by-sa-4.0.

This page in Markdown https://md.dictionary.elamur.ai/free/en/english/func/