best c operator #493

best c operator

  1. a = b: 0 votes
  2. a += b: 0 votes
  3. a -= b: 0 votes
  4. a *= b: 0 votes
  5. a /= b: 0 votes
  6. a %= b: 0 votes
  7. a &= b: 0 votes
  8. a |= b: 0 votes
  9. a ^= b: 0 votes
  10. a <<= b: 0 votes
  11. a >>= b: 0 votes
  12. ++a: 0 votes
  13. --a: 0 votes
  14. a++: 0 votes
  15. a--: 0 votes
  16. +a: 0 votes
  17. -a: 0 votes
  18. a + b: 1 votes
  19. a - b: 0 votes
  20. a * b: 0 votes
  21. a / b: 0 votes
  22. a % b: 0 votes
  23. ~a: 0 votes
  24. a & b: 0 votes
  25. a | b: 0 votes
  26. a ^ b: 1 votes
  27. a << b: 1 votes
  28. a >> b: 0 votes
  29. !a: 0 votes
  30. a && b: 0 votes
  31. a || b: 0 votes
  32. a == b: 0 votes
  33. a != b: 0 votes
  34. a < b: 0 votes
  35. a > b: 0 votes
  36. a <= b: 0 votes
  37. a >= b: 0 votes
  38. a[b]: 0 votes
  39. *a: 1 votes
  40. &a: 1 votes
  41. a->b: 2 votes
  42. a.b: 0 votes
  43. a(...): 0 votes
  44. a, b: 0 votes
  45. (type) a: 0 votes
  46. a ? b : c: 3 votes
  47. sizeof: 0 votes
  48. _Alignof (since C11): 0 votes
a + b: 1 a ^ b: 1 a << b: 1 *a: 1 &a: 1 a->b: 2 a ? b : c: 3 poll: best c operator option "a = b": 0 votes option "a += b": 0 votes option "a -= b": 0 votes option "a *= b": 0 votes option "a /= b": 0 votes option "a %= b": 0 votes option "a &= b": 0 votes option "a |= b": 0 votes option "a ^= b": 0 votes option "a <<= b": 0 votes option "a >>= b": 0 votes option "++a": 0 votes option "--a": 0 votes option "a++": 0 votes option "a--": 0 votes option "+a": 0 votes option "-a": 0 votes option "a + b": 1 votes option "a - b": 0 votes option "a * b": 0 votes option "a / b": 0 votes option "a % b": 0 votes option "~a": 0 votes option "a & b": 0 votes option "a | b": 0 votes option "a ^ b": 1 votes option "a << b": 1 votes option "a >> b": 0 votes option "!a": 0 votes option "a && b": 0 votes option "a || b": 0 votes option "a == b": 0 votes option "a != b": 0 votes option "a < b": 0 votes option "a > b": 0 votes option "a <= b": 0 votes option "a >= b": 0 votes option "a[b]": 0 votes option "*a": 1 votes option "&a": 1 votes option "a->b": 2 votes option "a.b": 0 votes option "a(...)": 0 votes option "a, b": 0 votes option "(type) a": 0 votes option "a ? b : c": 3 votes option "sizeof": 0 votes option "_Alignof (since C11)": 0 votes total votes: 10
 
ubq323 (bureaucrat) src #4746

poll, in 1 moment

ubq323 (bureaucrat) src #4747

now there is a poll.

ubq323 (bureaucrat) src #4748

i vote for -> for its whimsical charm

taswelll src #4749

the only important one

citrons (bureaucrat) src #4750

this one also amuses me so.

ubq323 (bureaucrat) src #4751

if apioforum had ranked-choice voting this might be more interesting. on the other hand, it mightn't be

quintopia src #4752

The most useful is probably a-=b since it's almost tc by itself. But it's not the most amusing

taswelll src #4753

actually, i think a(...) is the best, but also doesn't look like an operator. the other only important one

caesar src #4754

ternary operator 🥺

viba src #4755

&a tickles my brain in an inexplicable way

caesar (edited ) src #4756

brain tickling :3⊏

darxoon (edited ) src #4757

I was trying to explain why I chose *a but viba described it pretty fittingly, surprisingly. except that it's *a for me and not &a

munvoseli src #4758

yeet here be bitshift

like idk what "best" is but if u were classpecting me into this then i would be this, maybe

caesar src #4759

what is classpection?

munvoseli src #4760

homestuck

caesar src #4761

i don't want to read an entire webcomic to find out what classpection means

munvoseli (edited ) src #4762

classpecting is sorting you into your hogwarts house except there is a large quantity of houses

caesar src #4763

so classpection is a personality test?

munvoseli src #4764

essentially, i guess so

munvoseli (edited ) src #4766

it's more to do with powers and major plot points, sort of

minor spoilers, if it's spoilers at all dGhlICJoZWlyIG9mIGJyZWF0aCIgZG9lcyB3aW5keSB0aGluZ3MsIHRoZSAid2l0Y2ggb2Ygc3BhY2UiIGRvZXMgc3BhY2V5IHRoaW5ncywgdGhlICJrbmlnaHQgb2YgdGltZSIgZG9lcyB0aW1leSB0aGluZ3MsIHRoZSAic2VlciBvZiBsaWdodCIgZG9lcyBsaWdodHkgdGhpbmdzLgo=

an "a<<b" does << things, presumably, and i do << things sometimes

ubq323 (bureaucrat) src #4767

what kinds of << things do you do

munvoseli (edited ) src #4768

https://github.com/munvoseli/minv/blob/master/speed.c (defining u32 to be 64 bits (on my machine) is so great wow why did i do that)

and also attempts at decoding binary file formats use << and <<= a bunch

zagura src #4769

a ? b : c is just rly nice

gmestanley src #4784

agreed

flirora src #4785

A bit hard to decide but I’ll go with the ternary operator.

serverman1 src #4808

i dont even like c

please log in to reply to this thread