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 302243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:04:46+00:00 2026-05-12T07:04:46+00:00

Being a C novice I would like to hear what Macro defines developers are

  • 0

Being a C novice I would like to hear what Macro “define”s developers are using. I’ve been thinking about putting these in a header to skip verbosity I’ve become used to:

#define TS_ typedef struct {  
#define _TS(x) } x;

#define I(x)_ { int i; for ( i = 1; i <= x; i++ ) {  
#define _I } }

Can I add \n \t etc within these macros? As I would like to pass on my sourcecode minus the extra include:

#define TS_ typedef struct {\n
#define _TS(x) } x;\n

#define I(x)_ { int i;\n\tfor ( i = 1; i <= x; i++ ) {\n 
#define _I \t}\n}\n

Would these work?

ie: Can I use the proprocessor to replace my sourcecode with my personal include to formatted source without the include ?

Links to good preprocessor tips and tricks also appreciated.

  • 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-05-12T07:04:46+00:00Added an answer on May 12, 2026 at 7:04 am

    You can put whitespace in by escaping the newline

    #define SOMETHING whatever\
    This is part of the macro
    

    But as others have said it’s not really a great way to to do this.

    It would be much better to look into editor macros so you could type the shortcut and have the editor expand it.

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

Sidebar

Related Questions

Being new to VS, how may I think of these two concepts, what is
Being a bit perplexed about this issue by now, I hope some of you
I would like to be able to extract a number from within a string
I am using the following four buttons -- example on Fiddle I like the
I am hosting my Rails 3 application on Heroku and would like to add
I would like a PHP script to read the contents from a CSV file
I have a couple of, what may end up being for this forum, overly-novice
This is almost certainly a very novice question, but being as I am a
I am about to take the plunge and start using Git for actual projects
I am trying to write a function in PHP, but being a novice 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.