adding cascaded data in a text file

Dears,
Having a text file contains data like:
2
4
5
6
8
10
How to add the neighbouring data in C++, I mean
to add each two and three channels as:
6 (2+4)
11 (5+6)
18 (8+10)
and for three channels addition,
11 (2+4+5)
24 (6+8+10)

Thanks in advance
Last edited on
closed account (48T7M4Gy)
Having a text file contains data like:


You'll more than likely need a program for that. So it looks like this might be a start. http://www.cplusplus.com/doc/tutorial/files/
Topic archived. No new replies allowed.