How do you make a HTTP request with C++?

I had the same problem. libcurl is really complete. There is a C++ wrapper curlpp that might interest you as you ask for a C++ library. neon is another interesting C library that also support WebDAV. curlpp seems natural if you use C++. There are many examples provided in the source distribution. To get the … Read more

RPN Calculator for C++

This bit of code here Needs to move to main and slightly transform And that means you’ll need to rethink this loop while(input != “=”) You’re really close. Two suggestions: You can optimize the isOperator function. And since you know there is only one character in the operator, you can use something more elegant than if/else … Read more

Debug vs Release in CMake

With CMake, it’s generally recommended to do an “out of source” build. Create your CMakeLists.txt in the root of your project. Then from the root of your project: And for Debug (again from the root of your project): Release / Debug will add the appropriate flags for your compiler. There are also RelWithDebInfo and MinSizeRel build configurations. You can modify/add to the flags by specifying a toolchain file in … Read more

RPN Calculator for C++

This bit of code here Needs to move to main and slightly transform And that means you’ll need to rethink this loop while(input != “=”) You’re really close. Two suggestions: You can optimize the isOperator function. And since you know there is only one character in the operator, you can use something more elegant than if/else … Read more

Debug vs Release in CMake

With CMake, it’s generally recommended to do an “out of source” build. Create your CMakeLists.txt in the root of your project. Then from the root of your project: And for Debug (again from the root of your project): Release / Debug will add the appropriate flags for your compiler. There are also RelWithDebInfo and MinSizeRel build configurations. You can modify/add to the flags by specifying a toolchain file in … Read more

Passing as const and by reference – Worth it?

Passing by const reference is the preferred way to pass around objects as a smart alternative to pass-by-value. When you pass by const reference, you take the argument in by reference (avoiding making any copies of it), but cannot make any changes to the original object (much as would happen when you would take the parameters in by value). … Read more

#pragma once vs include guards?

I don’t think it will make a significant difference in compile time but #pragma once is very well supported across compilers but not actually part of the standard. The preprocessor may be a little faster with it as it is more simple to understand your exact intent. #pragma once is less prone to making mistakes and it is … Read more

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