What does “:=” do?

前端 未结 10 1674
别那么骄傲
别那么骄傲 2020-12-04 10:47

I\'ve seen := used in several code samples, but never with an accompanying explanation. It\'s not exactly possible to google its use without knowing the proper

10条回答
  •  粉色の甜心
    2020-12-04 11:24

    It's the assignment operator in Pascal and is often used in proofs and pseudo-code. It's the same thing as = in C-dialect languages.

    Historically, computer science papers used = for equality comparisons and for assignments. Pascal used := to stand in for the hard-to-type left arrow. C went a different direction and instead decided on the = and == operators.

提交回复
热议问题