what is meaning of this (!) and += operator

Status
Not open for further replies.

vead

Full Member level 5
Joined
Nov 27, 2011
Messages
285
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,815
Hello
I have confusing on two operators ! and +=

what is meaning of this operator ! in c programming

For Example
Pin = Low Pin is set to Low
if (!pin)

Does it mean check the condition if Pin is not low ?

what is meaning of this operator += in c programming

For example

int number = 1;
number += 60;
number +=62;
return number;
 

! operator is 'logical NOT'

if Pin is set to Low , then statement

if (!Pin)
test for final state to 'HIgh'

------
+= is a shorthand notation for addition and assignment.

number += 60; is same as
number=number+60;

(operator "+=" adds the right operand to the left operand and assign the result to the left operand.)
 
Reactions: vead

    vead

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…