Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
What does operator ':=' mean?

I am trying to compile pthreads for MSVC2015 and found some strange code.

localPtr->wNodePtr->spin := PTW32_TRUE;

What is this line doing?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

As others pointed out := is not a valid C-operator.

However, this "operator" := is found twice in the current "PThread for Windows" source release which seems to be as of v2.9.1.

Both occurencies appear in ptw32_OLL_lock.c, which proclaims to "implements extended reader/writer queue-based locks", but does not seem to be part of the pthread*.dll build, so the file ptw32_OLL_lock.c is not passed to the compiler.

Interesting enough the source file in question contains an int main() and is not in the testsub-directory.

All in all this seems to be alpha, beta or it's simply noise, so just delete it.

over 4 years ago · Santiago Trujillo Relatório

0

IIRC, C standard does not specify anything about := operator. So, most likely, it's not standard C.

However, AFAIK, some languages, which use the = as comparison operator, to separate the assignment from comparison, use := as assignment operator. [Example: Pascal, postgresql]

In some other cases, it carries a meaning that the variable is getting defined and assigned in the same step, to differentiate with normal assignment elsewhere. [Example: GO]

over 4 years ago · Santiago Trujillo Relatório

0

:= is not a valid operator in C.

It does however have use in other languages, for example ALGOL 68. Basically, for what you want to know, the := in this example is used to assign the variable PTW32_TRUE to localPty->wNodeptr->spin

This is done mostly to remove any ambiguity in code, as to avoid using '=' for assignment.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda