Category "c++"

Adding text and lines to the beginning of a file

I'd like to be able to add lines to the beginning of a file. This program I am writing will take information from a user, and prep it to write to a file. That

Storage of literal constants in c++

I would like to know where literal constants are actually stored in the memory? example: int i = 5; char* data = char* &("abcdefgh"); the storage sectio

convert uint8_t array to string in c++

This can be marked solved. The problem was the print macro. ESP_LOGx can't put out c++ Strings. I'm trying to convert an uin8_t array to a string in c++. The a

dll loacation Error by running a testcode

I am learning how to use dlls and how to export them. I have created a small program that calls the different components(classes, methods, functions, ect.. ) of

Proper implementation of global configuration

My goal is to have global constants in a C++ game I'm working on (to represent some graphics info and the like). My current implementation is to toss them all i

Linear index upper triangular matrix

If I have the upper triangular portion of a matrix, offset above the diagonal, stored as a linear array, how can the (i,j) indices of a matrix element be extrac

C++: Namespaces -- How to use in header and source files correctly?

Consider a pair of two source files: an interface declaration file (*.h or *.hpp) and its implementation file (*.cpp). Let the *.h file be like the following:

C++ program to find the closest number in the Fibonacci sequence

I need to write a program in C++ to find the closest Fibonacci number to the input number. I patched together a program that tells the Fibonacci number in the n

c++ QPushButton signal and slot

I have a problem creating a QPushButton and linking its signal to my slots. First, I created a class with the slot: class A : public QWidget{ public slots:

LNK2001 Error even though .cpp is being compiled

I'm working on a project where I'm using Bullet3 to add a Physics Simulation Component-System to EntityX. I'm getting link errors when compiling code, and I ca

Disable whole test case in gtest

How can one disable a complete test case in gtest? (all the tests in a test case, not just individual tests) The formatting proposed in the gtest doc is to org

Why is stack memory size so limited?

When you allocate memory on the heap, the only limit is free RAM (or virtual memory). It makes Gb of memory. So why is stack size so limited (around 1 Mb)? What

Logical indexing - numpy.where in C++

I have created a simple numpy array with shape (4, 2) called A. import numpy as np A = np.array([[1, 2], [2, 2], [3, 2],

PyArray_Check / PyArray_CheckExact gives segmentation fault

In c++, I define the following module: #include <boost/python.hpp> #include <numpy/arrayobject.h> bool foo(PyObject *obj) { if (!PyArray_Check

Segmentation fault in calling Python script from C++

Summary: I am getting a segfault when calling an embedded Python script, which somehow only happens when the script is called the second time around. Hello the

GMP Library, compile error in C++, MinGW, Code::Blocks

I have built GMP for MinGW. The IDE I'm using is Code::Blocks. I don't have any problems with C functions of GMP. But I'm having problem with C++. The program I

How is the UI of terminal texteditors implemented?

Terminal texteditors like emacs,vim,joe or even nano have the ability to display arbitrary UI elements inside a command line without completely rewriting the wh

C++ Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call

I am trying to program motorbee using c++ when I run the code I get the following error: Run-Time Check Failure #0 - The value of ESP was not properly s

C++ - Qt Creator - /How to have DOT and COMMA as decimal separator on a QDoubleSpinBox?

I am building a C++ GUI application on QT Creator. I changed the location to Portuguese/Brazil, now only comma is the decimal separator. I need the QDoubleSpin

How to get configuration.h from configuration.h.in in OpenSSL?

I am working with the OpenSSL library for C++. I used this library in another project and it worked great. I carried it over to another project today and I'm ha