1afe61c15SRodney W. Grimes.\" Copyright (c) 1989, 1990, 1993 2afe61c15SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 3afe61c15SRodney W. Grimes.\" 4afe61c15SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 5afe61c15SRodney W. Grimes.\" modification, are permitted provided that the following conditions 6afe61c15SRodney W. Grimes.\" are met: 7afe61c15SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 8afe61c15SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 9afe61c15SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 10afe61c15SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 11afe61c15SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 12*dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors 13afe61c15SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 14afe61c15SRodney W. Grimes.\" without specific prior written permission. 15afe61c15SRodney W. Grimes.\" 16afe61c15SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17afe61c15SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18afe61c15SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19afe61c15SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20afe61c15SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21afe61c15SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22afe61c15SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23afe61c15SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24afe61c15SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25afe61c15SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26afe61c15SRodney W. Grimes.\" SUCH DAMAGE. 27afe61c15SRodney W. Grimes.\" 28afe61c15SRodney W. Grimes.\" @(#)operator.7 8.1 (Berkeley) 6/9/93 297f3dea24SPeter Wemm.\" $FreeBSD$ 30afe61c15SRodney W. Grimes.\" 3111c39fb4SEd Schouten.Dd April 8, 2009 32afe61c15SRodney W. Grimes.Dt OPERATOR 7 33afe61c15SRodney W. Grimes.Os 34afe61c15SRodney W. Grimes.Sh NAME 35afe61c15SRodney W. Grimes.Nm operator 3611c39fb4SEd Schouten.Nd C and C++ operator precedence and order of evaluation 37afe61c15SRodney W. Grimes.Sh DESCRIPTION 38afe61c15SRodney W. Grimes.Bd -ragged -offset indent -compact 3911c39fb4SEd Schouten.Bl -column "! ~ ++ -- - (type) * & sizeof new delete" 403136363fSRuslan Ermilov.It Sy "Operator Associativity" 413136363fSRuslan Ermilov.It "-------- -------------" 42ace5be68SRuslan Ermilov.It "() [] -> . left to right" 4311c39fb4SEd Schouten.It "! ~ ++ -- - (type) * & sizeof new delete right to left" 44c2965cd1SJoel Dahl.It "->* .* left to right" 45ace5be68SRuslan Ermilov.It "* / % left to right" 46ace5be68SRuslan Ermilov.It "+ - left to right" 47ace5be68SRuslan Ermilov.It "<< >> left to right" 48ace5be68SRuslan Ermilov.It "< <= > >= left to right" 49ace5be68SRuslan Ermilov.It "== != left to right" 50ace5be68SRuslan Ermilov.It "& left to right" 51ace5be68SRuslan Ermilov.It "^ left to right" 52ace5be68SRuslan Ermilov.It "| left to right" 53ace5be68SRuslan Ermilov.It "&& left to right" 54ace5be68SRuslan Ermilov.It "|| left to right" 55ace5be68SRuslan Ermilov.It "?: right to left" 5611c39fb4SEd Schouten.It "= += -= *= /= %= <<= >>= &= ^= |= throw right to left" 5711c39fb4SEd Schouten.It "?: (C++, third operand) right to left" 58ace5be68SRuslan Ermilov.It ", left to right" 59afe61c15SRodney W. Grimes.El 60afe61c15SRodney W. Grimes.Ed 61afe61c15SRodney W. Grimes.Sh FILES 62afe61c15SRodney W. Grimes.Bl -tag -width /usr/share/misc/operator -compact 63afe61c15SRodney W. Grimes.It Pa /usr/share/misc/operator 64afe61c15SRodney W. Grimes.El 65