Stringizing Operator in C How to print a variable name in C?

PHOTO EMBED

Wed Jan 26 2022 08:37:37 GMT+0000 (Coordinated Universal Time)

Saved by @Yuktha139

/*
C program to demonstrate example of
Stringizing Operator
*/

#include <stdio.h>

#define getVariableName(x) #x

int main()
{
    int student_age = 21;

    printf("value of %s is = %d\n", getVariableName(student_age), student_age);

    return 0;
}
content_copyCOPY