in Compiler Design
807 views
1 vote
1 vote

Find no of tokens in following code:

#define square(x) x*x

int main(){
int a=square(2);
printf("%d", a);
return 0;
}

Does macro expansion effect  the  tokens  count??  

in Compiler Design
807 views

4 Comments

I didn't mean that you're mistaken. What i was thinking is that, when people make their own questions, they create even more confusion.
Earlier also there was a self made question on counting the number of tokens.
0
0
true.. even i have posted few self doubt which has turned into disaster but i feel thats how one can get the clear picture by resolving self doubt.  we read same book but sometimes we interpret differently  as we take our own assumptions as fact. Doubt help us to debunk such assumptions.

But on GO we have quality contributor too to help us out. So thank you @Manu
0
0

@Satyajeet Singh     char a[]={'c','a','t','r','a','t'};   total token=19     not 14 

read the last comment of this question https://gateoverflow.in/268033/self-doubt-token-count-character-literal#c285851

for more information read all comment of this https://gateoverflow.in/268033/self-doubt-token-count-character-literal#c285851

0
0

1 Answer

0 votes
0 votes
Yes total 19 tokens ARE THERE 'c' is considered as single token

Related questions