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

  • SEARCH
  • Home
  • 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 8551565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:13:24+00:00 2026-06-11T14:13:24+00:00

To correct for typos, and to add the issue I’m having which I forgot

  • 0

To correct for typos, and to add the issue I’m having which I forgot to mention, here is the macro:

#define SUFFIX .new
#define STR(x) #x
#define GENFILE(name,suff) STR(timings/name suff)

GENFILE(test1, SUFFIX)

The above code generates timings/test1 .new and if only I didn’t have that extra space, I would have what I want, how do I get around that?

  • 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-11T14:13:25+00:00Added an answer on June 11, 2026 at 2:13 pm

    There is no single token (call it “word” if you like) /test1. /test1 is the division operator / followed by the identifier test1, and they cannot be added together. Luckily, you don’t need to. If they appear together without any intervening spaces, and you stringize it, no space gets inserted. So just remove the ##.

    Also make sure your macro parameter name matches what you use in the definition. testname and name are not the same.

    #define STR(x) #x
    #define FILE(testname) STR(timings/testname)
    

    Update:

    Since you’ve edited your question, the above is no longer a complete answer.

    You get the space because you included a space in the macro definition, and you need to rewrite your macro definition to not include a space. One way to do it is with an extra macro like this:

    #define SUFFIX .new
    #define STR(x) STR_(x)
    #define STR_(x) #x
    #define ID(x) x
    #define GENFILE(name,suff) STR(timings/ID(name)suff)
    GENFILE(test1, SUFFIX) // expands to "timings/test1.new"
    

    Note that the STR macro now needs an extra helper macro too, to allow ID to get expanded before including it in the string.

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

Sidebar

Related Questions

I am hoping you can help me unravel an issue I am having with
I have a peculiar problem here. I want to extract some generic types, which
I'm having an SQL query (MSSQLSERVER) where I add columns to the resultset using
I'm using TFS source control. When I add a new resource key to my
What is the correct jQuery syntax to only select certain file types? e.g. $(#fragment-1
Correct me If I am doing wrong, I have just started to check WCF
Correct me if anything is wrong. Now when we use Spring DAO for ORM
correct me if im wrong, but isn't distributed SCMs for OS projects while centralized
Correct me If Im wrong. public class Person{ List<Cars> myCars; //Get and Set }
Please correct me if I am wrong, but is one complex query less expensive

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.