C++ Array Math | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C++ Array Math

I am a beginner in C++, but have been studying long enough to make a bsic calculator. I have been wondering though, is it possible to tell a funtion to find two separate pieces of data in an array and perform a math operation on them? For example, if I had an array of int basicArray [] {1, 2, 3, 4, 5}; Could I make a funtion find two of those numbers and perform math on them? Also, would this change their values within the array or could I just find those values, and then separately perform the equation in question?

30th Apr 2020, 10:51 PM
Coconuts Gaming
Coconuts Gaming - avatar
1 Answer
30th Apr 2020, 11:50 PM
BroFar
BroFar - avatar