The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+3 votes
161 views
#include<stdio.h>
#define decode(s,t,a,m,p,e,d)m##s##u##t
#define begin decode(a,n,i,m,a,t,e)
int begin()
{
    printf("hello");
}
asked in Programming by Active (2.6k points) | 161 views

1 Answer

+1 vote
There is no error. ## does string concatenation in a macro. So, macro will expand as follows:

begin -> decode(a,n,i,m,a,t,e) -> m##a##i##n -> main

So, the function name becomes main and program prints "hello"
answered by Boss (18.1k points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

38,235 questions
45,737 answers
133,030 comments
49,931 users