On this page
  1. func
  2. Availability
  3. Syntax & Overview
  4. Notes & Pitfalls
  5. Example

func

Prev: typeof | Up: builtins | Next: __FILE__
Rel: __FILE__, __LINE__
Ref: cppreference — func
Tags: #public #prog #c #builtins #tier/core


Availability

Built-in (Predefined Identifier (C99)) — requires no #include header.

Syntax & Overview

static const char __func__[];

Function-local predefined identifier holding the name of the enclosing function as a NUL-terminated string.

Notes & Pitfalls

Example

#include <stdio.h>

static void init(void) {
    printf("entering %s\n", __func__);
}
int main(void) { init(); }

Linked from

Related notes