String addition

c-plus-plus
stl
string

#1

Can someone please tell how to add two strings indexwise without using the loop method?

What i mean is: if I have string A; where A is of length 4 and values: ‘1’, ‘12’, ‘12’, ‘10’ ans string b; where b is ‘1’,‘2’,‘3’,‘4’, then by adding, i want ‘2’, ‘14’, ‘15’, ‘14’. The resultant is also of length 4 but notice the addition, its as per the index. IS there any stl function for the same?


#2

I think you are looking for this
http://www.cplusplus.com/reference/algorithm/transform/


#3

I’m wondering where are those “without using the loop” comming from :smiley:


#4

@princelegolas kind of… :stuck_out_tongue:


#5

@betlista from me… :smiley: