C++ How to Trigger Class Destructor

I'm developing a class to process config files, which consist of a number of segments, each segment with a number of key:value elements. I have the following code (pared down to just the basic issue): class cfgElement { public: char ...
more »

2017-02-20 16:02 (1) Answers

Is there a decltype equivalent in Swift?

In C++11 and latter, it is possible to use a compile time function like syntax named decltype() to reuse declaration type of a variable to declare another one without rewriting the type signature. Is there any equivalent syntactic tool in Swift? C++...
more »

2017-02-20 12:02 (1) Answers

Sorting by selection in an array c++

so my program should be able to take several numbers from the user until the last number is "999". Then, it should be able to print out an array having all the numbers entered sorted. I have to use sorting by selection (by comparing values in each in...
more »

2017-02-20 11:02 (0) Answers

C++ SFML Using Classes, Objects and Functions

I am trying to use functions and classes in C++ with SFML. In my code I have a game.cpp file which is the main file and a windowfill.h header file that I want to be able to use during the game. It should be a simple I think but I cannot find a way to...
more »

2017-02-19 22:02 (0) Answers

.lldbinit settings command not found - MacOS

My issue is that I cannot get Xcode's debugger to break at breakpoints in included .cpp files (from an externally built application, just trying to use Xcode as the debugger). I found that the answer is to add the following to the .lldbinit file: ...
more »

2017-02-19 17:02 (0) Answers

Calling a derived class from my driver.cpp

I would be very grateful for some help. In my computer science class, we're being asked to do something I've never done before, and I don't understand my problem well enough to even know what terms to Google. We have three files. lists.h, lists.cp...
more »

2017-02-18 23:02 (2) Answers

C++/Curl : How to send HTML formatted email

I want to send an email using using C++/curl with Visual Studio 2015, that will be html formatted looking like: Hello World! instead <strong>Hello World!</strong> How to format it so the client reads text as text/html not just pure t...
more »

2017-02-18 21:02 (0) Answers

Link 2019 error - unresolved external symbol

I tried reading this article, but I didn't really understand it to well: What is an undefined reference/unresolved external symbol error and how do I fix it? I copied this program straight from the book, and can't get it to work. I want to make su...
more »

2017-02-18 20:02 (0) Answers

Error while building Qt from source code on macOS

I want to be able to debug into qt source code so i started compiling the latest Qt version 5.8 on my MAC. I followed the instructions on Qt webpage about building it. But this is what i get after running configure. ../qt-everywhere-opensource-sr...
more »

2017-02-18 18:02 (1) Answers

Nested Structure With Class. Scope Error

I'm here trying to implement Linked Lists using C++. In the following program i'm trying to implement Linear Search using Linked Lists. But the SearchLL function in the following code, which is a friend function, is giving this error: error: hea...
more »

2017-02-18 16:02 (1) Answers

C++ initialization as function

I am spitting through some old C++ code. In it, I declare a local variable like this: Pen blackPen(Color(255, 0, 0, 0)); This seems to call the constructor. I am trying to make this a global variable, which I want to initialize in a function. How...
more »

2017-02-17 20:02 (2) Answers

How I can validate letters in c ++ with Try-catch?

I would like to improve the code below. I would like to use try-catch statement to validate the input letters. An error message should be printed in case the user inputs an invalid letter. I have two methods: showMenu and selectOperation. The metho...
more »

2017-02-17 18:02 (2) Answers

Does UINT_MAX have all bits set to 1?

This question is asked before but I am still confused. I know that unsigned int a = -1; would be UINT_MAX. But it is not because all bits of -1 is set. C11 says if the new type is unsigned, the value is converted by repeatedly adding or ...
more »

2017-02-17 12:02 (3) Answers

Selection sort Pointer issue

I'm having trouble with my selection sort. It's not sorting the list in ascending order, in fact it's not doing anything according to my debugger. I noticed when I debugged it on line 42 it skips the conditional statement and I am not understanding w...
more »

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