04
Nov
Increment(++) and decrement(–) operations
Related Blog Items
- C++ Basics Tutorial - Lesson 7
- Safe String Copy(strcpy) and Concatenate(strcat) Operations
- Detecting broken links in double linked list
- Binary Search Trees
- C++ Basics Tutorial - Lesson 3
In c : post and pre ++/– gives rvalue as result and takes an lvalue
So, x++++ gives error, next x++ evaluates to rvalue but next ++ operation requires lvalue
In c++ :
Post ++/– gives a rvalue as result
Pre –/++ gives a lvalue as result
So —-x works fine, x++++ doesnt work
X[i]=i++ works ?
Works but behaviour undefined coz we dont know leftside i will evaluated first or right side i evaluated
[tags] increment operation, decrement operation[/tags]
Popularity: 8%
You need to log on to convert this article into PDF
Related Blog Items - C++ Basics Tutorial - Lesson 7
- Safe String Copy(strcpy) and Concatenate(strcat) Operations
- Detecting broken links in double linked list
- Binary Search Trees
- C++ Basics Tutorial - Lesson 3
Related Blog Items
- C++ Basics Tutorial - Lesson 7
- Safe String Copy(strcpy) and Concatenate(strcat) Operations
- Detecting broken links in double linked list
- Binary Search Trees
- C++ Basics Tutorial - Lesson 3
[…] Read more: here […]
December 3rd, 2006 at 5:47 am