Join this community to post or comment

Jane Duong

Knowledge Sharing  - 
Cris Nego's profile photoVladimir Yakovlev's profile photoSheetal Chaturvedi's profile photoOnofre Souza's profile photo
But it is possible to gain some money doing videos like this one?
Add a comment...

divye prakash

Libraries & Frameworks  - 
C ++ have friend function that can access class's private data.. If you add a declaration of a freind function in one's header file containing classes and define that function using a scope resolution in your program.. Will that don't hurts or breaks the integrity of the data hiding and encapsulation. One can access one's class's private data! 
Christopher Hanks (cjhanks)'s profile photoMenne Kamminga's profile photo
+Christopher Hanks what I was trying to say, but better :)
Add a comment...

Róbert Tóth

Knowledge Sharing  - 
Little example about pure functions(functions without side effects)
Rahmawati Umi's profile photo
Add a comment...
Hey, guys.
How is going?
Some of my friends are complaining about white space use in C, C++ compilers in this case:
If (condition) { //statements

I am telling them to use else if in the same line, but they are not giving the properly fuck for best practices.

How to explain that is good maintain else and if together ?
Lion Figueiredo's profile photoAgron Selimaj's profile photo
Are you talking about the switch statement? It is better if you provide your example and your friends example in the pastebin and then put the links here.
Add a comment...

Stavros Skamagkis

Graphics & Games  - 
Write your own Tetris clone in C++ and SDL

This is a tutorial for beginners who desire to learn the logic required in order to create a simple Tetris clone in C++.

It uses the SDL library for graphics rendering, which is included in the source code.

The source code is platform independent:
It is ready to compile in Microsoft Visual Studio and there is also a linux version of the source code.

Kalani Murakami's profile photoMark F. Rodriguez's profile photoGerardo Reyes's profile photoTara Lawson's profile photo
hư vô
That's good to know. My blog's
Add a comment...

Andreas Fester

Knowledge Sharing  - 
Paolo Bolzoni's profile photoFlorian Philipp's profile photojeckziel cortes's profile photoShishir Pandey's profile photo
Given that you already use the <random> header, I suggest you use std::random_device [1] to seed std::default_random_engine.

You can also do other fancy stuff like combining time, thread ID and process ID into an acceptable seed using std::seed_seq but there is generally no need for this.

Using just time will definitely hurt you, no matter what PRNG you use. Imagine what will happen when you parallelize your program and every thread seeds its PRNG at the same time.

[1] Beware that some older GCC versions will drain significant system entropy if you do this. Newer ones fixed this issue. You can check with strace. Just check how many bytes are read from /dev/urandom. Should be a small number well below 100.
Add a comment...

Beldì Luca

Newbie Discussion  - 
Hi guys,
Ignorant question, I have 3 classes: A (pure virutal), B: public A and C: public A.
I now have a list of pointers of type A that points to ehiter type B or C objects. I know what type the pointer is pointing to.
What type of cast should I use to cast them back to B or C?
I've been using dynamic_cast but I gathered here it's not the right one. What should I use?
Christopher Hanks (cjhanks)'s profile photoMartin McDonough's profile photoGabriel Velasquez Soriano's profile photo
+Christopher Hanks Welcome to the C++ community.
Add a comment...

Omar El Gabry

Knowledge Sharing  - 
Implementation of interesting algorithms in C++ and their related problems on online Judges.

The project is Built under MIT license.
Erol B's profile photo김현준's profile photoZoltán Gönczi's profile photoMichael van der Westhuizen's profile photo
+Brett Cooper The code is correct. the comment by Robert was assuming a bug that doesn't exist at all! and I explained this in my first comment.

It's not perfect though, So, if you faced any issue please open a ticket. Thanks
Add a comment...

Sean Richards

Newbie Discussion  - 
I have created a custom data structure.
struct CitrixData
    string customerName;
    string application0;
    string application1;
    string sessionType;
CitrixData logs;

I populate the data and then I store it inside of a vector.
vector<CitrixData> *sessionData = new vector<CitrixData>;

// Store data in a vector

The problem is now I am parsing an extremely long file into a solo vector.  Not all the complicated.  However, I am trying to put the data back into my data structure to do some comparisons now.  I can't seem to find a way to do this. 

Here is my use case for the method
// 1. read in the first file
// 2. Start checking for duplicates
// 3. check for "No Apps" and fill in

void MyFiles::deduplicate(vector<CitrixData> *in, vector<CitrixData> *out)
    CitrixData inData, outData;

Basically I will be checking the usernames of vector entry for duplicates.  I can't seem to figure out how to get the data out of the vector.  I have googled but most of the examples don't talk about using objects to get the data out.  I was hoping something like in->popBack(in); would work but hasn't.
Beldì Luca's profile photoRobert Dailey's profile photoRahmawati Umi's profile photo
+Beldì Luca​ using them just to use them is pointless. They have a specific purpose, mostly involving generic algorithms. So you don't have to have specializations for pointers vs containers. Normal day to day STL usage, you can use the member begin and end functions just fine.
Add a comment...

Brett Cooper

Knowledge Sharing  - 
A great clip about using C++ to make generative art.
Generative Art in C++ webinar recording is now available. Learn more in this blog post that includes a link to the demo project and more.
Add a comment...

About this community

A community dedicated to C++ professionals and enthusiasts. ======================================                       COMMUNITY RULES ====================================== ⇨ NO CODE in posts or comments! ⇨ NO IMAGES OF CODE in posts or comments! ⇨ No job postings or advertisements! ⇨ Post in the appropriate category ⇨ Comprehensible English ONLY ⇨ Search before asking questions ⇨ Be mature! No profanity, no flaming, etc. ====================================== ** READ THE FULL RULES LINKED BELOW! ** If you need to share source code, do so by using a separate website and share a link to it (,, etc). Link to rules for mobile:

Zsolt Szatmári

Libraries & Frameworks  - 

I am looking for a crash reporter library. Something like this would be good:
Though the CrashRpt seems to be a bit abandoned, and I'd like to use it with VS2013 (and possibly 2015 and on later), and the homepage only mentions VS2012. 

It would also be nice to have an accompanying free crashreport-browsing web tool (similar to Crashlytics), but this is not a necessity.

So, can you suggest any alternatives, or share personal experience with CrashRpt?
CrashRpt is a free open-source library designed for intercepting exceptions in your C++ program, collecting technical information about the crash and sending error reports over the Internet to software vendor. Download Now. You can open the downloaded archive using 7-Zip program.
Markus Mohrhard's profile photo
Have a look at the breakpad library used in Chromium and Mozilla. and
Add a comment...

Mike Rotch

Knowledge Sharing  - 
Here’s a painless way to learn the basics of C++ from the ground up, whether you’re updating legacy code or writing brand new, efficient, high-performance code for new platforms, like phones, and want to take advantage of C++. You’ll learn the fundamentals of the C++ language, how to use the language and its Standard Library effectively, and how to use the Visual Studio environment for developing C++, including debugging, exploring code, and understanding error messages. This is your starting point for building software in C++
1) Fundamentals
2) The C++ Object Model
3) Pointers and Indirection
4) RAII – Resource Acquisition Is Initialization
5) The C++ Standard Library, or STL
Silviu Stere's profile photoSarah Rosen (Silencieux)'s profile photoJochen Paul (John AC Lupe)'s profile photoJohann Streitwieser's profile photo
I love this tutorial. They teach modern, idiomatic C++ from the beginning, which is important to foster good coding style.
Add a comment...

Florian Philipp

Design & Idioms  - 
Hi folks! I am wondering how the community feels about the ways C++11 has introduced for returning multiple objects from a function. Specifically, whether people embrace std::tuple and std::tie the same way Python coders use tuples and unpacking, and whether people rely on move construction or RVI at all.

So, when you have a function that returns multiple objects/values, how do you do it?
253 votes  -  votes visible to Public
Reference or pointer argument
Return std::tuple and use std::tie
Return std::tuple but don't use std::tie
Return custom struct
Something else
Marcelo Cantos's profile photoAlan Griffiths's profile photoJochen Paul (John AC Lupe)'s profile photo
It depend. For a widely consumed interface it makes sense to return a well named type that readers can reason about. For a one-use internal interface tuple/tie avoids the "naming problem".
Add a comment...
#CppCon 2015 Herb Sutter "Writing Good C++14... By Default"
Florian Biedermann's profile photoYuri Shang's profile photoFelix Löhr's profile photoOscar Sommerer's profile photo
The buffet and drinks must be some fancy stuff then.
Organic and CO2 neutral caviar and beer from local brewery.
That´s living!
Add a comment...
Bjarne Stroustrup “Writing Good C++14”

  #cpp   #cppcon   #cppcon2015  
torea foissotte's profile photoTara Lawson's profile photoOscar Sommerer's profile photoGary Friedman's profile photo
+Félix Vallières Goulet Me too. Hope they'll release other videos soon.
Add a comment...

Pat Le Cat

Knowledge Sharing  - 
Bjarne Stroustrup​ presented 3 sets of guidelines today at the CppCon which are aiming to help every C++ developer to produce better code by using modern C++ with no compromises to performance or security and for tools and library manufacturers and writers to offer common types and ways to check code through the compiler suite or tools like Lint. All in all those are aimed to make our lives easier by raising the standards for users and manufacturers/vendors! A laudable effort, let's see how it will evolve in the next few months.
#cpp #guidelines #bjarnestroustrup

Core-Guidelines on GitHub:
This morning in his opening keynote at CppCon, Bjarne Stroustrup announced the C++ Core Guidelines (, the start of a new open source project on GitHub to build modern authoritative guidelines for writing C++ code. The guidelines are designed to be modern, ...
Holger Jakobs's profile photoStephan Beal's profile photoMark F. Rodriguez's profile photoBrian Danilko's profile photo
+Mat Sutcliffe There's a big difference from early prerelease OS software being closed source and "the source will be released sometime after Windows binaries".
Add a comment...

Irfan Ismail

Knowledge Sharing  - 
Anybody know where I can learn using make and adding 3rd party library to my C++ project? 
Thank you.
Peter G. Marczis's profile photoLeonard König's profile photo
Make is nicely covered in brief in LearnCTheHardWay.
cmake is quite intuitive when you read some of it.

It basically generates makefiles/VS proj. or .sln / Xproj / etc. for you to use.
Add a comment...

Ender Grater

Newbie Discussion  - 
Anybody know where I can learn C++ easily for free?
Michael Gonzalez's profile photoRahmawati Umi's profile photoCola Kola's profile photo
Here are some other ones for you guys.
Add a comment...

Candice Hill

Graphics & Games  - 
You've explored skyboxes and porting DX 11 to 11.2, and you've played with sounds and shaders. How about a look at blending and models? Take the next step in game development, and learn how easy it is to implement techniques and to add features to your game engine.

Watch as experts Bryan Griffiths and Mickey MacDonald continue their C++/DirectX game development series with a deep dive into atmospheric effects, transparency, and third-party model importing, using the basic loader framework from Microsoft. They even look at new opportunities for students and professionals, in this popular course.
#gamedev #c #developers
Mcu Lover's profile photoWilliam Kerper's profile photo
Add a comment...

Prasun Tiwari

Newbie Discussion  - 
Can somebody explain me what are the differences between static cast and reinterpret cast in explicit type casting?
Jon Dubovsky's profile photoRobert Dailey's profile photo
dynamic cast by itself isn't bad. It's the common misuse of it that is: down casting in a class hierarchy is a smell for poorly designed software.
Add a comment...