C++11 is the successor to the C++03 standard, adding various core language changes and fixes, and an improved and expanded standard library.

learn more… | top users | synonyms (1)

6
votes
0answers
12 views

Nothing compiler/interpreter, Part 2

Part 1 I've followed some of the suggestions: Adding newlines to error messages Implementing options (I decided to use boost instead of getopt) Using strerror for fstream failure Things I did not ...
5
votes
1answer
54 views

IP Range Port Scanner

I've been working on this project to learn networking and concurrency as well as C++11 practices. I'm just looking for a general code review. ...
4
votes
1answer
52 views

Sprite cache and Directory reader

I have been fiddling around with creating my own Sprite Cache. Currently, I am using the C header file, dirent.h, to open up a directory and load all .bmp files. I ...
1
vote
2answers
83 views

Implementing object associations

I tried to find a generic way to deal with associations. I ended up with this code which seems to fit my needs: ...
4
votes
0answers
91 views

Factory with raw pointers

I'm designing a Factory in C++ with raw pointers, but I'd like to use smart pointers when possible as is recommended with the Factory pattern in newer C++. Unfortunately my compiler is a bit old (gcc ...
2
votes
1answer
39 views

Get K most frequent tokens from a token stream

This is an interview problem: Given a token stream, find the K most frequent tokens in real time (the order of these k tokens does not matter). My approach: Use a hash table (...
-1
votes
0answers
47 views

Text-based RPG game skeleton [closed]

I'm new to programming and I wanted to try my hand at it. Right now I have not gotten very far, but I'm working on the foundation. The model I'm following for this game is borrowed from other ...
4
votes
1answer
38 views

Adding/changing ID3 tags to media files with “artist - title” format

This code puts or changes ID3 tags to media files based on their file names. It assumes the files are in this format: morbid angel - maze of torment.mp3 The ...
3
votes
0answers
69 views

An attempt at implementing Maybe in C++11

I gave a shot at implementing Maybe for C++ and a slight twist in my implementation is that it uses thread_local static instance ...
2
votes
1answer
57 views

Making sequence unique with removal records

I'm working on a tool to detect all exact tandem repeats in a DNA/RNA sequence. Part of the algorithm requires finding Longest Common Extension (LCE) values, which although can be computed in constant ...
6
votes
3answers
500 views

Largest palindrome that can be made from a product of 2 3-digit numbers (Project Euler 4)

This is my solution to Project Euler #4, which asks for the largest palindrome that can be made from a product of 2 3-digit numbers. I have done a brute force method, but it takes around 10-20 seconds ...
11
votes
1answer
132 views

I made an implementation of std::deque, in my own way…?

In fact, entire deque header, though. According to Wikipedia, common implementations of std::deque include: Storing deque contents in a circular buffer, and only resizing when the buffer ...
2
votes
0answers
32 views

Platform independent leak/cyclic dependency detection of objects

Sometime back I came across a bug where a particular object was leaking but it was very hard to identify the root cause. I knew that it was due to a cyclic dependency (which usually indicates a bug in ...
6
votes
3answers
113 views

BST C++ STL implementation, visiting algorithms

I am currently learning C++, and as an exercise I tried to implement a BST in a C++11. I am not sure at all if what I have done could be considered a good example of c++ programming, thus I would love ...
1
vote
2answers
48 views

Variables for creating a 5x5 box

I have to create a 5x5 box using the images, and my first solution was to create 25 variables and print them, which is very inefficient. How can I optimize this? This utilizes cocos2d-x. ...
5
votes
2answers
132 views

Two-player Mancala

After playing Mancala with my brother, I thought coding the game would be a fun project to practice my abilities in C++. I am relatively new to programming, having only done a few small projects to ...
13
votes
1answer
122 views

TCP Socket Wrapper

I'm trying to build a simple server software for training purpose, most likely a IRC server, but I'm not there yet. I'm currently implementing a TCP socket class, to ease the use of the C socket API. ...
4
votes
1answer
68 views

Rvalue copy and and assignment for secure array class [closed]

I have a C++03 library with lots of classes. I'm interested in trying to take advantage of Rvalues and move semantics under C++11 for two or three critical classes. Once of the critical classes is a ...
2
votes
1answer
33 views

Policy classes for making widgets

I have been learning C++ for the past few weeks, and I made my first try with policy classes. Ultimately my goal is to use policy classes to manufacture wrapper classes on an ...
2
votes
1answer
69 views

Implementing Snap-To-Edge Functionality

Recently I've written some code which implements snap-to-edge functionality for some windows. There is some code duplication as you can see. I think this code can be simpler or possibly improved. ...
0
votes
1answer
42 views

Dictionary file manager

The dictionary class loads entries from a file and then can perform operations on them. The dictionary class then stores the entries back into the file. I would like to know the best way to check if ...
3
votes
1answer
81 views

Event-listener implementation

While writing a C++ GUI application more or less from scratch I needed some form of an event-listener system, preferably using lambdas. An event should be able to have multiple listeners and the user ...
6
votes
2answers
173 views

Binary serialization library

I am currently working on a binary serialization library written in C++11 for a personal project. I'd really like to have a review about my design, my implementation and everything else. The library ...
1
vote
0answers
62 views

Instance depth ordering system

I have created a template class that manages instances; by order of depth and order of addition (both ascending). It allows for a user to add and remove instances, to retrieve a vector of a layer, ...
5
votes
1answer
70 views

Design of class Location in a World in a universe

A Plane of existence is like a universe in the multiverse. At first, I thought that a Plane will consist of many Worlds, and ...
2
votes
1answer
89 views

Mth to last element

This is a challenge from codeeval Write a program which determines the Mth to the last element in a list. Input sample: The first argument is a path to a file. The file contains the ...
0
votes
2answers
50 views

Observer pattern implementation

I'm reading Head First Design Patterns and I'm currently reading about the observer pattern. Is what I produced correct? ...
5
votes
2answers
55 views

Basic OpenGL Renderer class

I made this Renderer class recently, to simplify the user interface of my library's API. I would like to ask advice about the move semantics (copy constructor, ...
2
votes
1answer
44 views

Implementation of Sequence Alignment in C++

Below is my implementation of the dynamic programming solution to the sequence alignment problem in C++11: ...
0
votes
1answer
91 views

Immutable C++ String class

I have project where I will need to create lots of immutable strings. If I am using std::string, which has huge overhead - about 60-70% against ...
13
votes
2answers
163 views

How to speak Brainfuck: for beginners

The following code transforms multi-line input into the the Brainfuck equivalent. One line turns into one program. The resulting programs are split by newlines for readability. Brainf.cpp ...
3
votes
2answers
160 views

Measure execution time of sorting algorithms

I have to measure execution time of certain sorting algorithms being passed as functions in following program. I also do not have to measure it on random container but also on ascending as well as ...
3
votes
1answer
85 views

Detecting cycles

This is a challenge question from codeeval.com: Given a sequence, write a program to detect cycles within it. Input sample: Your program should accept as its first argument a path to a ...
8
votes
2answers
181 views

Yet another OpenGL Shader: the Builder pattern and lifetime management

I've noticed that whenever a shader program class is implemented (from some questions on this site, as well as more reputable implementations), that: The class tries to do too much. Binding to the ...
6
votes
2answers
200 views

Stack implementation with a linked list

Could anyone provide any constructive criticism? I'm trying to get a jump on data structures before classes start. One thing is that I should add a copy constructor and assignment operator. Changes ...
12
votes
4answers
967 views

Binary Search Tree - C++

I'm implementing several data structures in an attempt to learn C++. Below is a binary search tree that I've implemented to learn about pointers, dangling pointers, and memory leaks. I was hoping ...
3
votes
2answers
85 views

Integer to English Conversion

I wrote some code to translate numbers ( for now just positive, up to the 32bit limit ) into English words. Everything works and I'm happy. I searched through the site looking for a comparison code ...
6
votes
3answers
88 views

C#-like properties

I'm studying metaprogramming I figured out a way to implement C#-like properties in C++. This is proxy object that performs a specified function when you try to receiving or assigning values. ...
10
votes
2answers
144 views

OpenGL game engine

I'm making a C++ game engine for entertainment and am using OpenGL to render my stuff. I made a batch renderer that was able to render 50K sprites with 300 FPS (untextured). My old setup that was able ...
6
votes
2answers
119 views

Contact search application

Create a C++ program which will act like contact search app in mobile. For example, if the following contacts are saved in contact list: Massi Pradip Prasad Praveed Raju ...
8
votes
1answer
68 views

AL N*N Tic Tac Toe Game - 2

Base on the previous question: AL N*N Tic Tac Toe Game Here is a summary of improvements: Deleting the Match class for its expensive calling constructor ...
11
votes
2answers
70 views

Unit testing with a singly linked list

To hone my skills with C++11, I'm implementing a singly-linked list based on the requirements I found at this link. I've implemented code that supports the following subset of requirements from the ...
3
votes
2answers
133 views

AL N*N Tic Tac Toe Game

Here is a simple Tic Tac Toe game. I would like to know how I can improve this code further. ...
8
votes
5answers
245 views

RingQueue implementation using std::array

I've recently finished implementing a ring queue based on std::array in C++11. I tried to write the code as if I were going to submit it to the C++ Standard ...
2
votes
2answers
81 views

DailyProgrammer Balancing Words Challenge

I'm hoping for someone to help me use the best practices and further make my code better that I used to accomplish the DailyProgrammer Challenge "Balancing Words". The challenge is to check if a word ...
5
votes
2answers
128 views

C++ 2D shape intersections - template reduction

I've created a short piece of code to determine whether or not various 2D shapes (circles/lines/rectangles) intersect. It was a job interview question, but now it's just about self-improvement. I'd ...
5
votes
4answers
265 views

Sufficient implementation of subset sum for 45 min interview

I am preparing for interviews, and have implemented a solution to this problem from Geeks for Geeks: Given a set of non-negative integers, and a value sum, determine if there is a subset of the ...
2
votes
1answer
82 views

Interview adjacency list graph problems in C++: proper graph implementation

I know this type of question has been asked before. However, my reason for asking it is gaining insight into what is expected in a 45 min interview when asked to implement graph algorithms. I have ...
5
votes
1answer
142 views

C++11 recursive atomic spinlock

Could you please review my spinlock implementation? ...
1
vote
0answers
29 views

Creating class method using macro to accept Visitator for each of their fields

I had a lot of classes that used a macro with listed fields. The macro was used to serialization, more like MSGPACK_DEFINE. I need a substitution of this mechanism, ...