C++ on Stack Overflow and Game Dev

0 answers

Compile error - Invalid types 'char[int]' for array subscript

I'm working on a program that does some matrix math. Fortunately the code logic is not what is giving me the errors. I am using the following code to output a matrix that is stored in a 2-d array: ...

0 answers

Clearing receive buffer in modbus library

I am using Modbus library from below link for arduino Modbus library. Indivually for each slave device the code working fine. Now I have connected multiple device with loopback test. I am getting ...

0 answers

Define INFINITY = (1/0) within Python, use it for C++ and JavaScript

Currently, I am reading the source codes of V8, and I found the INFINITY was defined here in Python define INFINITY = (1/0); Then it could be used within C++, here. # define V8_INFINITY INFINITY ...

2 answers

How to print strings with floats using Arduino's Serial.println

I've been printing a combination of strings and numbers with Arduino's Serial.println() like: Serial.println(String("some value: ") + String(some_value)); And this seems to work for most types, but ...

2 answers | 5 mins ago by Cerin on Stack Overflow stackoverflow.com
0 answers

How to change directory of a library in ros package

I have installed opencv2.4.9(With No CUDA) by unzip opencv2.4.9.zip in home. Many successful codes are using this library. Now I wanna rebuild opencv2.4.9(with CUDA) in another folder. I don't wanna ...

1 answer

Unmanaged C++ wrapper for C# usage

SOLVED: Thanks to Casey Price for their answer. I then ran into 2 other errors: BadImageFormatException and FileNotFoundException, the former was solved by matching the platform target (x64 or x86) ...

1 answers | 7 mins ago by Dom W on Stack Overflow stackoverflow.com
3 answers

How to push values in a list of lists in Qt?

In header file, I have this: private: Q_PROPERTY(QList <QList <QString> > dummy READ dummy WRITE setDummy NOTIFY dummyChanged) QList <QList <QString> > m_dummy; ...

3 answers | 7 mins ago by CoffeeDay on Stack Overflow stackoverflow.com
3 answers

How to build and use Google TensorFlow C++ api

I'm really eager to start using Google's new Tensorflow library in C++. The website and docs are just really unclear in terms of how to build the project's C++ API and I don't know where to start. ...

3 answers | 9 mins ago by theideasmith on Stack Overflow stackoverflow.com
5 answers

Create sequential variable names using a loop in C++

I'm trying to create variable names using a loop. Specifically, I am using this structure: struct card{ string rank; string suit; }; This is the rest of my code as it stands, and where it ...

4 answers

how to recompile with -fPIC

I was trying to reinstall my ffmpeg like this guide on my ARM Ubuntu machine. Unfortunatley, when I compile a programm which uses this lib I get the following failure: /usr/bin/ld: ...

1 answer

BFS starting with a given node and reaching all nodes

I have a scenario where I want to run BFS starting at a particular node(let's say ID:7). If there are nodes unreachable from this node, I want to restart the BFS(with any remaining node) until ...

0 answers

In Qt Quick application, Element mess up in developed application run on full HD phone

I developed application on Qt Quick, I arranged size and space of all elements based on semi HD screen, It looks good in every semi HD phone, but when I try to run this application on full HD phone, ...

1 answer

VC++ 2013 Debugger Freezes

Whenever I press F5 to compile and run a C++ program in Visual Studio 2013, the program stops responding without outputting any error. The cursor becomes busy and the application just hangs. Here are ...

1 answers | 41 mins ago by Jason on Stack Overflow stackoverflow.com
0 answers

CMAKE cannot find Boost

I am trying to build Point Cloud Library on Windows. https://github.com/PointCloudLibrary/pcl This library requires Boost library and I have installed it properly. However, when I use CMAKE to ...

3 answers

converting (file reading) function return value to c_str() not behaving as expected

I have a function that reads a file and returns a string. string get_file_contents(const char *filename) { ifstream in(filename); if (in) { ostringstream contents; ...

3 answers | 49 mins ago by slmyers on Stack Overflow stackoverflow.com
7 answers

to_string is not a member of std, says so g++

I am making a small vocabulary remembering program where words would would be flashed at me randomly for meanings. I want to use standard C++ library as Bjarne Stroustroup tells us, but I have ...

7 answers | 51 mins ago by Anurag Kalia on Stack Overflow stackoverflow.com
2 answers

Using same random number generator across multiple functions

I am given to believe that random number generators (RNGs) should only be seeded once to ensure that the distribution of results is as intended. I am writing a Monte Carlo simulation in C++ which ...

5 answers

Casting GetProcAddress returned pointer in C++

GetProcAddress returns a function pointer. Lets suppose we get the address of the function Beep ( its declaration can be found at WinBase.h (when including Windows.h)) BOOL WINAPI Beep( _In_ DWORD ...

5 answers | 55 mins ago by Pat on Stack Overflow stackoverflow.com
0 answers

SFML/C++ sf::Texture applied in a wrong way

In my 2D isometric engine, i have the following classes : `maps(variable)/layers(variable)/cubes(variable)/sides(6)/points(4)/coordinates(3)` Each sides contains 4 points(1 point = 1 ...

3 answers

Modifying sequence operations with external condition

Often I find myself working with some STL container and wishing to modify it based on some external condition. By external, I mean something that cannot be derived from the object in the container ...

3 answers | 1 hour ago by killogre on Stack Overflow stackoverflow.com
1 answer

Hanging of XShmPutImage event notification

I am using XShm extension to draw and manipulate images in Linux. In order to not have screen flickering, I am passing send_event = TRUE to XShmPutImage and then waiting for the event with XIfEvent, ...

1 answers | 1 hour ago by johnfound on Stack Overflow stackoverflow.com
0 answers

Sequential Access Files Problems in C++

The program should read in a C++ program from a cpp file, and prints all non-keyword identifiers into a text file. First in load function, I am trying to code 3 different ways to read the cpp ...

1 answer

How to import local c++ shared library .so into Android studio 1.5?

I have a simple question, but very specific. I built in a c++ project (non-android) a shared library .so which I'm using for others projects. I want to use it now to develop an Android app with ...

1 answer

How can I call a constructor in main() c++?

I have two classes. fileInfo.cpp: #include <iostream> #include <string> #include <fstream> using namespace std; class fileInfo{ private: string fileName; string fileType; ...

0 answers

Exponentially grow the number of processes in C++

I am writing an application the sends messages between processes in C/C++ and this is the code I have so far: #include <sys/types.h> #include <sys/msg.h> #include <stdio.h> #include ...

0 answers

Shedskin can't locate module numpy

I'm using shedksin to convert a python file (that is dependent on numpy) to a C++ file. When executing through command prompt I get the error. Any ideas on what might be the problem ?

1 answer

remove words of a text file from a map in C++ without loop

I try to make a set to store certain words of a text file. Then I want to remove these words from a map, which I already made up. I have successfully made a set to store these words, but I cannot ...

0 answers

How to use static_assert used with a member initilizer list

I would want to use static_assert to enforce various limitations on configuration of my class. Earlier I would just use an enum and only allow a single constructor which requires said enum to enforce ...

1 answer

I keep getting the same error message: Segment Fault (core dumped)

I am very new to C++ and all things computer-related, so go easy. I am trying to use a vector for the first time in an assignment for my class. I managed to get my code to compile, but halfway through ...

1 answers | 1 hour ago by TingRay on Stack Overflow stackoverflow.com
0 answers

C++, can't assign a new value to dynamically allocated array

I'm trying to write a hash table implementation of map, and I'm running into some error that crashes the program when I try to run it - specifically when I try to put new values into the map. This is ...

15 30 50 per page
1 2 3