Code:
#include<stdio.h>
#define decode(s,t,u,m,p,e,d)m##s##u##t
#define mepco decode(a,n,i,m,a,t,e)
int mepco()
{
printf("hello");
}
#include<stdio.h>
#define decode(s,t,u,m,p,e,d)m##s##u##t
#define mepco decode(a,n,i,m,a,t,e)
int mepco()
{
printf("hello");
}
Surprisingly,this code works succesfully....:D
Letz see how the hell does this code work....:)
Firstly,## is known as token merging operator.
and #define is a macro which replaces a word with another word that is specified....
So,in our code....
decode (s,t,u,m,p,e,d)m##s##u##t..........4,1,3,2 characters of the given string
similarly mepco decode (a,n,i,m,a,t,e) => m,a,i,n
Thus, int mepco() finally becomes int main() during the pre-processing stage itself and hence the code works....:)