Getting input as mm/dd and separating it

I've been working on a project. Where you get the input as: mm/dd as an example 12/30. But hey, there's the challenging part. I tried to use atoi and stoi... actually here's the code: Date::Date(const char* date){ string s; s = date; string delim...
more »

2017-03-19 16:03 (0) Answers

Xcode does not find C++ static library

So I had some issues with this before but I deleted my old question and updated it to this one. Here it goes: I want to use a C++ Library in my iOS Swift project. With the help of this community I compiled my library as a static library (.a file). N...
more »

2017-03-19 13:03 (1) Answers

C++ RadixSort efficient ways

I am trying to implement the Radix Sort algorithm in C++ trying to sort an int array. As far as I see, there are two possible ways: Sort by binary digits, e.g. get bit after bit using bitwise operators and sorting them in 2 buckets (0 and 1). Sort...
more »

2017-03-19 10:03 (1) Answers

cannot instantiate abstract class c++

I have a problem with this code - this is taskData: static std::map<int8_t, std::vector<Task>> taskData; and there is a problem: taskData.emplace(pi::enumerations::taskManager::taskCategory_t::SECURITY, std::vector<Task>{Firefig...
more »

2017-03-18 10:03 (3) Answers

How can I get a integer value from DLL in VBA?

I'd like to get the integer value from DLL in VBA as the below code. double _stdcall pll_dll(double* datain0, double* datain1, double* dataout0, double* dataout1, BSTR * str, int* str_len) { char buff[128] = { 0 }; char * str0; char str1[128] = { 0 ...
more »

2017-03-17 07:03 (1) Answers

Correct type to use for "context" pointers

It is common for C-style APIs that take a function pointer as a callback to also take a pointer-sized argument as a "context", that is passed into the callback so that information can be passed from the call-site to the invocation of the callback. Fo...
more »

2017-03-16 04:03 (0) Answers

Unpacking C++ pointer/reference syntax

Recently I had a knowledge check that included code that continues to confuse me. Here it is: #include <iostream> using namespace std; int f1(int *a) { return *a + 1; } int *f2(int *a) { return a + 1; } int *f3(int &a) { ret...
more »

2017-03-15 21:03 (3) Answers

Thread 1: EXC_BAD_ACCESS (code 1) error

When I run this short program, I generate the error "Thread 1: EXC_BAD_ACCESS (code 1)". Can anyone help me determine the cause of the problem? //populates matrix with rand nums void popMat(int x[][4096]){ for(int i = 0; i < 4096; i++){ for(i...
more »

2017-03-15 05:03 (1) Answers