Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda