Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
what is this kind of usage, ``braces inside parentheses'', called in C?
while (({bool a; a =a&&false; a;})) {
    ;
}

will work well.

but

while ({bool a; a =a&&false; a;}) {
    ;
}

end up with

filename.cc: In function ‘int main()’:
filename.cc:103:10: error: expected primary-expression before ‘{’ token
   while ({bool a; a =a&&false; a;}) {
          ^
filename.cc:103:10: error: expected ‘)’ before 
‘{’ token
   while ({bool a; a =a&&false; a;}) {
         ~^
          )
filename.cc:103:35: error: expected primary-expression before ‘)’ token
   while ({bool a; a =a&&false; a;}) {

what keyword should i refer to if i want to learn more about it?

i have seached keywords such as ``braces inside parentheses in C'' but in vain

other attempts:

while (({ ; })) {
    ;
}
filename.cc:105:16: error: could not convert ‘({...})’ from ‘void’ to ‘bool’
   while (({ ; })) {

it seems that ‘({...})’ is a type, something like int, float. am i right? or it is something like lambda function in c++?


thanks to @user2864740, @o11c, @paddy, my problem is solved. it is some kind of ``statement expression'' only available in gcc.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!