Skip to content
Home » C Program Without Main() Function using Token-pasting Operator (##)

C Program Without Main() Function using Token-pasting Operator (##)

Learn about C Program Without Main() Function using Token-pasting Operator (##) in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

We used the Token-pasting Operator in this program. The token pasting or token merging operator is the ‘##’ operator. As a result, the “m##a##i##n” becomes “main.”

C Program Without Main() Function using Token-pasting Operator (##)

#include<stdio.h>
#define fun m##a##i##n
int fun()
{
  printf("Hello, World.\n");
  return 0;
}

Output:

Hello, World.

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Codes :
C Program Without Main() Function using preprocessor
C Program to Find Largest Number – Dynamic Memory Allocation