A header/source split separates what callers need to know from the function body.

Header Source Boundary

header_source_boundary.cpp
#include <iostream>

int cubeVolume(int side) {
    return side * side * side;
}

int main() {
    int side = ;

    int volume = cubeVolume(side);

    std::cout << "side=" << side << std::endl;
    std::cout << "volume=" << volume << std::endl;
    return 0;
}
#include <iostream>

int cubeVolume(int side) {
    return side * side * side;
}

int main() {
    int side = ;

    int volume = cubeVolume(side);

    std::cout << "side=" << side << std::endl;
    std::cout << "volume=" << volume << std::endl;
    return 0;
}
#include <iostream>

int cubeVolume(int side) {
    return side * side * side;
}

int main() {
    int side = ;

    int volume = cubeVolume(side);

    std::cout << "side=" << side << std::endl;
    std::cout << "volume=" << volume << std::endl;
    return 0;
}
declaration and definition Headers commonly hold declarations, while source files hold definitions; this single-file version keeps the helper visible before `main`.