• Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search

Krafty Internet Marketing Forum Internet Marketing Tips, Tricks, Courses & Bots! Internet Marketing Courses! Assignment

 
  • 0 Vote(s) - 0 Average
Assignment
beinghchinmay
Offline

Member

Member
Posts: 1
Threads: 1
Joined: May 2016
Reputation: 0
#1
05-20-2016, 09:57 PM
The basic assignment operator (=) assigns a value to a variable. The lefthand operand is always a variable. The righthand operand can be any expression?any simple literal, variable, or complex expression. The righthand operand's value is stored in the variable named by the lefthand operand.

Because all operators are required to return a value, the assignment operator returns the value assigned to the variable. For example, the expression $a = 5 not only assigns 5 to $a, but also behaves as the value 5 if used in a larger expression. Consider the following expressions:

Quote:$a = 5;
$b = 10;
$c = ($a = $b);
 
The expression $a = $b is evaluated first, because of the parentheses. Now, both $a and $b have thesame value, 10. Finally, $c is assigned the result of the expression $a = $b, which is the value assignedto the lefhand operand (in this case, $a). When the full expression is done evaluating, all three variablescontain the same value, 10.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode