0

What is the meaning or use of int++in an while loop?

figure out

25th Nov 2016, 12:36 PM
Bindurani Johnson
Bindurani Johnson - avatar
4 Réponses
+ 3
int++ ? I have never seen that. You can't increment a datatype! First declare a variable then increment that variable. Like: int x; x++;
25th Nov 2016, 1:28 PM
Alireza M
Alireza M - avatar
+ 1
increment..in loop output
25th Nov 2016, 12:40 PM
Bindurani Johnson
Bindurani Johnson - avatar
0
You would usually increment an int in a loop to count how many times it repeats. Whether it's to repeat a specific number of times (should probably use a FOR() loop for that, really) or simply using cout << i++ in debugging to keep track of exactly how many times that loop repeats.
25th Nov 2016, 1:56 PM
Matthew Shephard
Matthew Shephard - avatar
- 1
It would increment an int
26th Nov 2016, 2:15 AM
ryan simethy
ryan simethy - avatar