Category "c++"

How to join two Bezier curve using C1 continuity?

How to draw Two Cubic Bezier Curve using 8 Points The last point of the first curve will be the starting point of second curve What I am doing wrong ?? Please H

Add and subtract integers of arbitrary size

I am tasked to implement from scratch addition and subtraction of signed integers of arbitrary size. Such an integer is stored in an array of 64-bit unsigned in

Why can’t my code find the second smallest elements array?

int smallindex = 0; int secsmallindex = 0; I put the lines above into gobalslope. The rest of the code: #include <iostream> using namespace std; int ma

Copy information from file to variables

#include <iostream> #include <stdio.h> using namespace std; struct Table{ char fullname [100]; int group; int firstMarks[5]; int se

How to pass template variadic arguments by reference in C++?

I want to get repeated inputs, therefore I made the function to get inputs with variety of types. template <typename InputType> void get_inputs(const std:

Code exiting when Dynamic Array of class allocated

I am trying to dynamically allocate an array and whenever it gets to the part where it dynamically allocates the program exits. I would rather not use vectors a

Passing a pointer to a class member function as a parameter

I have written a small program where I am trying to pass a pointer to member function of a class to another function. Can you please help me and where I am goin

What problem do C++20 concepts really solve? [duplicate]

I'm trying to understand what problems C++20 concepts are solving and how exactly they are helpful to the end user. I understand that it helps

Array gives different values in main() and in a function() [closed]

I am trying to store a 1d array that stores random numbers into another 2d array. So as you can see, I am trying to store the passed random ar

declare and using enum class and using in one statement

When using scoped enums I stumbled over some syntax which is accepted by Microsoft, but not by clang or gcc: using enum class Color { RED, GREEN, BLUE }; (ht

How template deduce const pointer type?

I've tried following codes in cppinsights: #include <iostream> #include <string> #include <type_traits> #include <vector> template<t

(esp 32) http.GET() is so slow

I want to get data from REST API by an esp32 and turning on and off LED lights(GPIO 26 and 27). Here is my code : #include <HTTPClient.h> #include <Ard

C++: Undefined reference to Casadi

Here is my source code #include <casadi/casadi.hpp> int main(int argc, char** argv) { casadi::SX x = casadi::SX::sym("x"); return 0; } I use gcc v

C++: Undefined reference to Casadi

Here is my source code #include <casadi/casadi.hpp> int main(int argc, char** argv) { casadi::SX x = casadi::SX::sym("x"); return 0; } I use gcc v

C++ How to read/split EPRT command?

I am currently writing a C++ FTP server and I was wondering what would be the best way to read the EPRT command from the client. << DEBUG INFO. >>:

Permission Denied when trying to use open() with POSIX commands in C++

I currently have this code where I need to use standard POSIX calls to write text to a file: file = open(filename, O_CREAT | O_RDWR | O_APPEND, S_IRUSR | S_IWUS

Member specialization does not match any template declaration

The code below compiles except for the lines template <> std::map<std::string, std::function<Goo*(Foo*)>>& Factory::getMap<Goo, Foo*>

How to best design function that takes an unary predicate

I'm implementing a simple timeout-class which calls a given function when time runs out. However I'm scratching my head on how to make the function constructor

enforce typetrait for all subclasses

is there are a way I can check during compile time, that all subclasses of a given class satisfy a given typetrait? For example: I want to make sure that all cl

Console output giving unexpected number after a simple calculation? c++

This is an assignment that I am doing for university and I have not had many problems with assignments up until this point. I would expect my program to be work