Questions about C++, a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

learn more… | top users | synonyms

0
votes
0answers
19 views

Web Services of System Integration

I have been assigned to a system integration project. However, I do not understand part of the integration implementation architecture. For example, I have a passport scanner connected to a Windows ...
0
votes
0answers
36 views

Memory management scheme for custom memory allocator

I am in the process of implementing a small memory manager. The users of this memory pool will always access the memory bytes via handles. So a memory allocation/deallocation is done with two APIs: ...
1
vote
0answers
38 views

Need some recommendations for writing modern, consistent cross-platform C++ code [on hold]

I have mostly C# and JavaScript experience for about 5 years. Before that I programmed some years in C/C++ just for fun, so I know how to deal with raw pointers and destructors. I am familiar with ...
-1
votes
0answers
23 views

human readable rules to C++ API [on hold]

I am looking for a library/engine that takes human readable rules and compile them into c++ code. Does something like this exist or would I have to write my own?
0
votes
0answers
63 views

GSP Algorithm explanation

I've been trying to implement the GSC algorithm in C++, however I need help with clarifying the definition: http://en.wikipedia.org/wiki/GSP_Algorithm GSP Algorithm makes multiple database ...
-2
votes
0answers
60 views

Photoshop/GIMP curves tool - how does it work internally [on hold]

PROBLEM I've been given a task to understand and make a tool similar to Photoshop's/GIMP's curves tools. I'm using c++ with Qt (and can use any library that can be used commercially). I'm a newbie ...
0
votes
2answers
144 views

Value of passing by reference [duplicate]

In C++, we have the option to pass by reference or pass by value. The client code does not need to know which one a parent function uses; that is, int func(int param) and int func(int &param) are ...
-2
votes
0answers
37 views

Developing Windows Phone and Windows 8 in C++ : Available resources? [on hold]

I've already read that most people suggest that one should develop for Windows / Windows Phone using C#. However, I would like to keep developing in C++, since I use this language for both Windows and ...
-2
votes
1answer
116 views

Good program to test skills and how to know when I am a competent programmer? [on hold]

I am almost done learning c++ off of learncpp.com I want to know what is a project that I can work on once I am done that will test everything I have learned and allow me to learn what it is like to ...
-5
votes
0answers
56 views

how to learn c++ if you know nothing about programming? [on hold]

I have tried online tutorials and books but I can't find one that is fun or explains without that techy vocabulary, is there any book that is fun or is for beginers that don't know anyting.
2
votes
1answer
50 views

Python API: Extension Module or Pure Module

We have a C++ application, with C++ interfaces changing regularly during development. We also have a C API which is designed to be stable in spite of such changes; the C API is tighly focused on ...
-5
votes
0answers
61 views

How to become malware analyst [closed]

I am willing to be a malware analyst. I am 17 years old and want to be guided. I tried learning x86 assembly form (the art of assembly) but it was complex and I believe that it is very old (I don't ...
0
votes
1answer
116 views

How to turn a GUI C++ application into distributable executables? [on hold]

Wanting to get into game development, I read a number of questions on this and other sites about saw that one of the popular suggestions was to use SDL in C++. So I worked on this, and I made a few ...
-2
votes
0answers
33 views

Android Application and game development [closed]

I am really confused what to do! I want to create Games and applications for android in c++. I know I should use android ndk but I don't know how to start with it, And what things do I need. Can ...
0
votes
1answer
55 views

OpenSSL Client model for half duplex communication over socket

I have read in this SO question that OpenSSL socket communication can be only half duplex in a single thread. Assuming what I have read is true, I am wondering if I can apply philosopher's dining ...
5
votes
2answers
483 views

How do I deal with classes that are only used once, say in only a single function?

I have a class that basically builds up a memory-efficient version of a structure to be used in a performance-critical section of code. The resulting structure is ugly but extremely fast, so not ...
0
votes
0answers
42 views

How does the android JNI work [closed]

I am currently trying to create an iPhone/android app I have chosen to write the model of my program in C++ since it is supported by both platforms. I have been able to compile my C++ source into the ...
3
votes
1answer
314 views

Why do programmers still use “SAFE_DELETE”?

If I had a dime for every time I've seen this macro in use, today I would be coding just for fun: #define SAFE_DELETE(p) if ((p) != NULL) { delete (p); (p) = NULL; } Why do programmers insist in ...
-1
votes
0answers
39 views

How do I stop characters sent to PuTTY screwing with its title/output? [migrated]

I'm sending JSON to PuTTY on Windows from a C++ program running on an mbed. I've escaped the characters \, /, ", \b, \n, \f, \r, \t as per json.org. But I still have three quirks that I do not ...
0
votes
3answers
204 views

What does “ (int) value & 0x1, (int) value & 0x2, (int) value & 0x4, (int) value & 0x8 means”

The "value" ranges from 0 to 15 (it's possible values). When will those 4 "if"condition be met? If my (int)value = 2 does this mean 0010? if ((int)value & 0x1) { ...
17
votes
4answers
522 views

How bad is it calling println() often than concatenating strings together and calling it once?

I know output to the console is a costly operation. In the interest of code readability sometimes it is nice to call a function to output text twice, rather than having a long string of text as an ...
2
votes
4answers
1k views

Going through The C Programming Language K&R in Visual Studio

From what I have read, K&R seems to be a good place to start learning programming in general, and C programming specifically. However, I've just started the first chapter and I have a few ...
-1
votes
1answer
108 views

Programmer Analyst vs Software Engineer [closed]

So I've heard the job title "programmer analyst" and "business analyst" thrown around for software jobs recently. How do the responsibilities of Programmer Analysts, Business Analysts and Software ...
3
votes
3answers
190 views

Data Oriented Design - impractical with more than 1-2 structure “members”?

The usual example of Data Oriented Design is with the Ball structure: struct Ball { float Radius; float XYZ[3]; }; and then they make some algorithm that iterates a std::vector<Ball> ...
-3
votes
1answer
110 views

C++11 introduction of new programming trends and potential fragmentation of the language [closed]

In my humble opinion, the fact that the C++ language with the introduction of C++11 lives a renaissance is unquestionable. New powerful features were introduced, that give to the programmer advanced ...
2
votes
1answer
140 views

Code re-use in C++, via multiple inheritance or composition? Or…?

I originally asked this question on StackOverflow, but I was directed here, and I think my problem is perhaps as much conceptual as technical, so here goes. If you’re defining a hierarchy of abstract ...
2
votes
2answers
126 views

When does extracting methods from code stop to make sense? [duplicate]

I am currently studying the refactoring methods defined by Marting Fowler (http://refactoring.com/catalog/). He states a tip for replacing chunks of code by a single method that does that job. So ...
1
vote
4answers
576 views

Why would a C executable be smaller when compared to C++ executable

I'm trying to understand why the output file sizes are significantly different when using a C and a C++ compiler. I was writing a small hello world program in C and C++, I noticed that in C version, ...
0
votes
1answer
64 views

GUI code implementation for specific Window/Form class

Terminology Element/Form Element -> Fields such as text list, combo_boxes, push buttons, etc. Problem I have a program that is basically a fat client that interfaces into a system that keeps track ...
-4
votes
1answer
186 views

High level languages compared with visual programming environments [closed]

Could I have a professional view on the effectiveness of visual block-based programming environments ( a program such as 'blockly' or 'scratch' or 'app inventor') in comparison to high level ...
0
votes
0answers
27 views

C++, namespaces, name lookup on inherited class and Qt [migrated]

I have built Qt5 with the QT_NAMESPACE=Qt_ns option. The following code compiles OK. But why? QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE namespace test_ns { class ...
1
vote
3answers
135 views

How to make a random-access archive of text files?

I wrote an application that tests the performance of evolutionary algorithms. This application performs a run of the algorithm which consists of several generations. The data which is produced by my ...
2
votes
2answers
245 views

What is a good C++ API Design for HW registers?

I am designing an API for a driver that manipulates HW. I have done the following: namespace HWRegister { //private: namespace Data { //accessible only within this namespace ...
1
vote
0answers
221 views

Using local variable assigned to return value of a function or using function directly [migrated]

Is there a difference between this: MyClass c = getMyClass(); calculate(c.value); and this: calculate(getMyClass().value); in the scope of performance and memory allocation?
1
vote
0answers
70 views

A program to verify ability to read text and understand it [closed]

My little sister still does not read very well - but she keeps playing on computer quite often and she asks me for every little thing she could read herself. It's not that I didn't want to help her, ...
1
vote
3answers
81 views

Setting global parameters: is this a reasonable use of const_cast and volatile?

I have a program that I run repeatedly with various parameter sets. Different parameters are used in different parts of the program (including different source files). The same parameter may also be ...
2
votes
3answers
235 views

Transitioning from Java & C to C++

I learned Java and I'm pretty competent programming in it. I also learned C recently. I looked at a comparison between Java and C++ and I like C++'s features like operator overloading and its speed. ...
1
vote
1answer
126 views

Where does `this` go in a x64 thiscall?

So I understand that thiscall doesn't really exist in x64 programming. However, I can't really find any definitive explanation as to where the this pointer is put to be passed to the callee. Is a x64 ...
3
votes
2answers
336 views

Why doesn't C++ allow you to take the address of a constructor?

Is there a specific reason that this would break the language conceptually or a specific reason that this is technically infeasible in some cases? The usage would be with new operator. Edit: I'm ...
1
vote
3answers
142 views

Is storing pointer (of new'd object) in static collection from object constructor a common idiom in C++

In code I am reviewing a common approach I see to storing objects (eg a socket client object), is use a static container to hold the objects. The objects are created by some helper function, eg like ...
6
votes
4answers
444 views

Split up large interfaces

I'm using a large interface with about 50 methods to access a database. The interface has been written by a colleague of mine. We discussed this: Me: 50 methods is too much. It's a code smell. ...
1
vote
3answers
141 views

Is heap fragmentation a problem in bare-metal arm with g++?

I am converting a project from C to mixed C/C++. It is going quite nice, and the new features are really lightening the work. The platform is an ARM SAM4, compiler is arm-none-eabi-g++. This is not a ...
1
vote
1answer
105 views

Subscript/assignment binary operator in C++

I was designing a kind of a parser when I thought that it would be nice to have an operator overload like this: operator[]=(subscipt_type s, rvalue_type val). For example we have a class: ...
0
votes
2answers
243 views

Usage of raw pointers

So from the top-voted answer to this question, it appears that using raw pointers for storage isn't frowned upon so much. However, then what is the point of a std::weak_ptr? I thought that storage was ...
2
votes
1answer
116 views

acceptance test driven development in c++

Was put on hold at stack overflow: hopefully it has value here. I want to use a BDD / TDD / ATDD approach in c++. However I really want to emphasize vertical slices of end to end functionality rather ...
0
votes
0answers
39 views

How would I do a vim-style character text editor in a graphical application?

There's a cool guitar tabbing application that I've used before where you can use the keyboard to move around a character grid. You can put any digit in any character cell. Here is an image: This ...
1
vote
4answers
215 views

Combinatorial explosion of interfaces: How many is too many?

I'm a relative newcomer to OOP, and I'm having a bit of trouble creating good designs when it comes to interfaces. Consider a class A with N public methods. There are a number of other classes, B, C, ...
3
votes
3answers
228 views

Genetic Algorithm new generation exponentially increasing

I'm programming Genetic Algorithm in C++ and after searching all kind of ways of doing GA'a operators (selection, crossover, mutation) I came up with a doubt. Let's say I have an initial population ...
3
votes
1answer
185 views

High-level description of how experimental C++ features are developed?

Herb Sutter in a video answers a question about the concepts proposal considered for C++11 and from his remarks it sounds like multiple groups offered prototype implementations but all of them left ...
0
votes
1answer
237 views

Algorithm to Copy data faster than windows default copy provider

I need an algorithm which can copy data(files/folder) from one place to another, faster than windows default copy/paste option. I'm working in vc++. Is there any algorithm by which I can do copy/paste ...