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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:53:14+00:00 2026-05-25T21:53:14+00:00

In a .h file I defined: #define PAIR_TYPE(type1, type2)\ typedef struct { \ //

  • 0

In a .h file I defined:

#define PAIR_TYPE(type1, type2)\
    typedef struct {     \     // added \ after edit  
      type1 first;       \     // added \ after edit  
      type2 second;      \     // added \ after edit  
    };     // added ; after edit        
#define MAKE_PAIR(val1, val2) {val1, val2}
PAIR_TYPE(char *, uint32_t) mypair;
mypair foo();

In the .c file I used it like this:

mypair foo()
{
   mypair p;
   uint32_t bar = calculate();
   p = MAKE_PAIR("normal", target);
   return p;
}

However I get this error:

error: expected expression before ‘{’ token

The line it points is:

p = MAKE_PAIR("normal", target);

I don’t know why it says ‘{‘ !!! there is no ‘{‘ at that line.

  • 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-25T21:53:15+00:00Added an answer on May 25, 2026 at 9:53 pm

    You need more backslashes on the lines after ‘{‘

    #define PAIR_TYPE(type1, type2)\
      typedef struct {\
        type1 first;\
        type2 second;\
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Non inline function defined in header file with guards #if !defined(HEADER_RANDOM_H) #define HEADER_RANDOM_H void
it's all in index.php /* Define site root */ defined('DOCUMENT_ROOT') ? null : define('DOCUMENT_ROOT',realpath(dirname(__FILE__)));
I have an aidl file defined as follows: package com.erbedo.callalert; interface RemoteCallAlert { void
I have a web page with swf file defined this way <object width=600 height=400
I am using the following to search for a file defined as a macro
I understand that we need to create MXML file to define a view. Suppose
In my .htaccess file I have defined following rule, RewriteRule t/([^.]+)/$ /videos/tag.php?tag=$1 [QSA] The
In my .htaccess file I have defined the following rule to make my register
Say I have a struts.properties file with a defined value uploads.directory . How can
I always used a normal PHP file and just defined the variables in that

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.