[Solved] (C++) What does it mean when a data type is between a ” sign? [closed]


They’re templates.

Function templates are special functions that can operate with generic types. This allows us to create a function template whose functionality can be adapted to more than one type or class without repeating the entire code for each type.

for example:

template <class C>
C add (C a, C b) {
  C result = a + b;
  return (result);
}

int a = 1;
int b = 2;

add<int>(a, b); //returns 3

float c = 1.5
float d = 0.5

add<float>(c, d) // returns 2.0

1

solved (C++) What does it mean when a data type is between a ‘<' and '>‘ sign? [closed]