Function to convert little endian bytes into big endian
Includes
We have included &lt;iostream&gt; twice, but missed &lt;cstdio&gt;.
Misspelt standard library identifiers
std::printf, std::uint8_t and std::uint64_t are consistently misspelt.  You might sometimes get away with this, as your standard library is allowed to add global-namespace versions of those identifiers; since it's not required to do so, you have a portability bug.
Use appropriate size type
std::size_t is the appropriate type to use for the size of an object, rather than std::uint64_t (which could be unnecessarily big, or - theoretically, at least for now - too small).
Conversion function shouldn't have side-effects
The printf() calls within convertLittleToBig make it unusable in any serious program.
Consider a standard algorithm
The &lt;algorithm&gt; header provides a very useful std::copy() function we can use if we have a reverse iterator to copy from or to.  We can get suitable iterators from std::span views onto the inputs (from C++20 onwards).
Avoid raw pointers
We could do better, using a template to accept values and return by value, inferring the size from the argument type:
#include &lt;algorithm&gt;
#include &lt;span&gt;

template&lt;typename T&gt;
T convertLittleToBig(const T&amp; val)
{
    auto in = std::as_bytes(std::span(&amp;val, 1));
    T result;
    auto out = std::as_writable_bytes(std::span(&amp;result, 1));
    std::copy(in.rbegin(), in.rend(), out.begin());
    return result;
}

That's much simpler - no counting needed, and the caller doesn't need to use sizeof (to work with odd-sized values, they need to be passed as arrays).
This is how we'd use it in a simple test program:
#include &lt;cstddef&gt;
#include &lt;cstdlib&gt;
#include &lt;iomanip&gt;
#include &lt;iostream&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
    
std::string to_hex(auto const&amp; val)
{
    std::ostringstream oss;
    oss &lt;&lt; std::hex &lt;&lt; std::setfill('0');
    auto in = std::as_bytes(std::span(&amp;val, 1));
    for (auto c: in) {
        oss &lt;&lt; std::setw(2) &lt;&lt; std::to_integer&lt;unsigned int&gt;(c);
    }
    return oss.str();
}

// hex-print the value and its reversal
void demo_endian_swap(auto const&amp; val)
{
    std::cout &lt;&lt; to_hex(val) &lt;&lt; &quot; -&gt; &quot;
              &lt;&lt; to_hex(convertLittleToBig(val)) &lt;&lt; '\n';
}

#include &lt;array&gt;
int main() {
    // Demonstrate a selection of types
    demo_endian_swap(std::uint16_t{0x1234});
    demo_endian_swap(std::uint64_t{0x123456789abcde});
    demo_endian_swap(std::array&lt;unsigned char,5&gt;{1,2,3,4,5});
    //demo_endian_swap(&quot;abc&quot;);    // Invalid - can't return an array
    //demo_endian_swap(std::string{&quot;abc&quot;}); // oops - reverses whole structure
}

Example output:
3412 -&gt; 1234
debc9a7856341200 -&gt; 00123456789abcde
0102030405 -&gt; 0504030201