cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
array and ++ operator
array and ++ operator
Jul 20, 2017 at 3:28am UTC
ahswong
(32)
whats the difference between the two codes below?
1
2
tests[i]++; tests[i]tests[i++];
Jul 20, 2017 at 12:05pm UTC
jonnin
(11429)
1) increments the value inside array tests at location i
2) (? do nothing ?) followed by incrementing i which moves to the next location if accessed via i again.
not sure what #2 is trying to do though, its not a sensible statement.
Last edited on
Jul 20, 2017 at 12:10pm UTC
Jul 20, 2017 at 2:36pm UTC
keskiverto
(10399)
Why don't you write a simple test program that uses both "codes" and shows the results of each case?
Jul 21, 2017 at 3:47am UTC
ahswong
(32)
@keskiverto that's exactly what i did and i figured it out.
Topic archived. No new replies allowed.