Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7769545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:11:10+00:00 2026-06-01T16:11:10+00:00

I discovered something interesting while writing code. I defined a macro in my code

  • 0

I discovered something interesting while writing code. I defined a macro in my code and accidentally used the keyword int as the variable name of parameter of that macro. The code worked perfectly fine, but I’m a bit surprised about it. I have read that in C keywords are reserved words and cannot be used as variable names.

This is my code:

#include <stdio.h>

#define PRINT(int) printf("%d",int)

int main()
{
    int x=2;
    PRINT(x);
    return 0;
} 

Can anyone explain me why is it working fine? Is it not true that keywords are reserved and cannot be used as variable names in C, or is this some exception in C for macros?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:11:11+00:00Added an answer on June 1, 2026 at 4:11 pm

    In this context, int is not a variable (more correct: parameter) name because of course PRINT is also not a function — it’s a preprocessor macro.

    Whatever you write as part of a macro definition is only looked at by the preprocessor. By the time the compiler gets to see the processed source nothing remains of the "int" name.

    This is similar to what happens with formal parameters of functions: the compiler gets to see those names, but after it’s done with the source no trace of them remains in the compiled code (so you need to load debug symbols in the debugger to “get this information back”).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using MS Test and the code coverage support I discovered something with 60% line
I just discovered a bug where the code looked something like this: char *foo
I discovered something unfamiliar while reading Objective-C manual for @encoding . Table 6-2 Objective-C
I've discovered something interesting. I'm using ajax in a carousel structure to add more
I am looking at something that I discovered in an old code base, and
Discovered something and am looking into a bit of incite as to why one
Today I discovered something that makes me sad: objects of type System.Generic.Collections.List don't have
I'm currently doing some last-measure optimizations, mostly for fun and learning, and discovered something
I was debugging something and discovered some strangeness in JavaScript: alert(1=='') ==> false alert(0=='')
I've discovered this idiom recently, and I am wondering if there is something I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.