Friday, 6 May 2016

Write a program to print a string without main function

 
This is simple program hack. It can be achieved through function macro. Here main function is renamed as begin function. During pre-processing phase, begin is replaced as main function.


#include<stdio.h>

#define decode(s,t,u,m,p,e,d) m##s##u##t

#define begin decode(a,n,i,m,a,t,e)

int begin()
{
   printf("hello");
}