unsigned int (c++) vs uint (c#)

C++ and C# are different languages. They have different rules for handling type promotion in the event of comparisons. In C++ and C, they’re usually compared as if they were both unsigned. This is called “unsigned preserving”. C++ and C compilers traditionally use “unsigned preserving” and the use of this is specified in the C++ … Read more

Get Unix timestamp with C++

C++20 introduced a guarantee that time_since_epoch is relative to the UNIX epoch, and cppreference.com gives an example that I’ve distilled to the relevant code, and changed to units of seconds rather than hours: #include <iostream> #include <chrono> int main() { const auto p1 = std::chrono::system_clock::now(); std::cout << “seconds since epoch: ” << std::chrono::duration_cast<std::chrono::seconds>( p1.time_since_epoch()).count() << … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)