add

Add any two numbers together

add<return_type>(a, b);

will return the sum of the two given numbers together. The return_type specifies in which data type the sum will be returned in, like shown in below example:

add<int>(5, 15.1); //20
add<float>(0.2, 3); //3.2
add<bool>(-1, 200); //1
------------------------
add<char>('a', 1); //'b'
add<string>("abc", "abc"); //abcabc

Last updated