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

learn more… | top users | synonyms

5
votes
1answer
259 views

Deploying Qt-based app on Mac OS X

I wrote a cross platform application and I distributed it successfully for Windows and Linux (and tested them on "clean" virtual systems, with no other additional software and/or libraries installed). ...
4
votes
4answers
4k views

Books about learning programming with C++ as a first language [duplicate]

Possible Duplicate: Recommended books on C++ Is there a canonical book on learning programming with C++ as a first language? I have toyed with Java and Python but when my laptop broke I ...
3
votes
6answers
891 views

How did you pick up the art of solving real life problems? Can you shortcut the process?

I have been coding on and off on C and to a certain extent on C++ since my college days(2003), but I never had the opportunity to work with a hard core programming responsibility, which could have ...
42
votes
6answers
7k views

Is `catch(…) { throw; }` a bad practice?

While I agree that catching ... without rethrowing is indeed wrong, I however believe that using constructs like this: try { // Stuff } catch (...) { // Some cleanup throw; } Is acceptable in ...
13
votes
7answers
1k views

Does C# experience translate well to C++?

My programming classes in school were C++, but I ended up working a job doing C# for the last few years. If there was a position that required say 1 or 2 years experience in C++, would my experience ...
12
votes
6answers
992 views

Is it a good habit to use C expressions in C++ code?

At school we started learning C this year, despite the fact I'm way ahead of class, and I learned Java, C++ and C while the class is at the base of C. Anyhow, I've been documenting myself, reading ...
11
votes
3answers
2k views

QT-C++ vs Generic C++ and STL

Been brushing up on my C++ lately, on Ubuntu QQ. I love the Qt framework for everything, especially building GUI's. I became quite familiar with it when using PyQt over the last few years. When ...
8
votes
3answers
521 views

How to migrate my thinking from C++ to C#

I am an experienced C++ developer, I know the language in great details and have used some of its specific features intensively. Also, I know principles of OOD and design patterns. I am now learning ...
8
votes
7answers
5k views

C/C++ Best indentation length? [closed]

I was reading a Vim tutorial ( http://www.oualline.com/vim-cook.html#drawing ), and came across this: This is very useful if you use a 4 space indentation for your C or C++ programs. (Studies at ...
7
votes
3answers
337 views

Change of the complexity class through compiler optimization?

I am looking for an example where an algorithm is apparently changing its complexity class due to compiler and/or processor optimization strategies.
7
votes
9answers
1k views

Is it any good to use binary arithmetic in a C++ code like “C style”?

I like the fact that the C language lets you use binary arithmetic in an explicit way in your code, sometimes the use of the binary arithmetic can also give you a little edge in terms of performance; ...
6
votes
1answer
260 views

Difference between language virtual machine and emulating vm?

I'm having a hard time understanding the difference between an emulation virtual machine and a language vm. I started with the research and implementation of an emulation virtual machine. Primarily ...
5
votes
5answers
770 views

In C++, is it a reflection of poor software design if objects are deleted manually?

With the advent of smart pointers, is it a sign of poor design if I see objects are deleted? I'm seeing some software components in our product that people are still doing this. This practice strikes ...
4
votes
6answers
6k views

What does it mean to do a “null check” in C or C++?

I have been learning C++ and I am having a hard time understanding null. In particular, the tutorials I have read mention doing a "null check", but I am not sure what that means or why it's necessary. ...
3
votes
3answers
783 views

A question about storing passwords

I'm creating a program (in C++) that will password protects its user's database (.dat) file. I'm confused on where to store the password? In the user's database file or somewhere else. I'm new to ...
3
votes
2answers
427 views

How do .so files avoid problems associated with passing header-only templates like MS dll files have?

Based on the discussion around this question. I'd like to know how .so files/the ELF format/the gcc toolchain avoid problems passing classes defined purely in header files (like the std library). ...
2
votes
3answers
853 views

Specific reasons to create own array class over using std::array?

What specific conditions or requirements should you create your own array over using std::array? Here is my background: I'm developing a small simple library that a small group of people will use ...
24
votes
0answers
2k views

What are the advantages of the Intel C++ compiler? [duplicate]

What are the advantages over the Intel C++ Compiler over the (much cheaper) free alternatives, such as gcc?
18
votes
10answers
4k views

Do we still have a case against the goto statement? [duplicate]

Possible Duplicate: Is it ever worthwhile using goto? In a recent article, Andrew Koenig writes: When asked why goto statements are harmful, most programmers will say something like ...
18
votes
10answers
4k views

Why is Java considered more portable than other languages like C++?

What differs between "writing a specific JRE for each platform" for Java developers and "writing a C++ compiler for each platform" for C++ ones?
10
votes
10answers
979 views

What is the best aproach for coding in a slow compilation environment

I used to coding in C# in a TDD style - write/or change a small chunk of code, re-compile in 10 seconds the whole solution, re-run the tests and again. Easy... That development methodology worked ...
8
votes
2answers
524 views

Refactoring several huge C++ classes / methods. How to start? [duplicate]

Possible Duplicate: I’ve inherited 200K lines of spaghetti code — what now? I'm dealing with legacy code. It contains some BIG classes (line count 8000+) and some BIG methods (line count ...
8
votes
7answers
1k views

What is idiomatic?

I understand an "idiom" to be a common operation or pattern that in a particular language is not simplified by core language syntax, such as integer increment: i = i + 1; In C++, this idiom is ...
6
votes
8answers
2k views

C++ to friend or not to friend

I have an object oriented programming with c++ course this semester at college and we were learning about friend functions. I instinctively dislike them for their ability to bypass the security that ...
5
votes
3answers
580 views

Handling false positives and legacy code warnings in static-analysis of C++ code? [closed]

We have a large "legacy" C++ code base on which no static analysis is run at the moment. Every now and then, we are thinking about at least using cppcheck, maybe via Visual Lint. (I've also briefly ...
4
votes
5answers
664 views

Thoughts on web development architecture through integrating C++ in the future to a web application

I'm looking to build a website (it's actually going to be a commercial startup) I saw this question and it really shed some light on a few things that I was hoping to understand (kudos to the op). ...
4
votes
2answers
1k views

C++ GUI Design & Programming

I am familiar with the basics and fundamentals of C++ and now I would like to move on to designing and coding GUI features of it, interactive dialogues, etc... like VB or Delphi Where do I start ...
3
votes
2answers
176 views

Custom graph comparison?

I'm trying to compare two graphs using hash value ( i.e, at the time of comparison, try to avoid traversing the graph ) Is there a way to make a function such that the hash values compared can also ...
3
votes
6answers
823 views

“As” Naming Convention

I'm experimenting with a naming convention I've devised and am seeking opinion. It involves the use of an "As" infix, and at this point I am envisioning it in the context of JavaScript, C# and C++ ...
2
votes
2answers
148 views

Injecting dependencies (DI) in c++ applications

I am playing with dependency injection, but i am not sure I am doing it right. Especially, I am not sure what should be the correct way to build classes with injected dependencies. Say I have a class ...
2
votes
3answers
328 views

To store data or not?

I'd like to ask you about one simple thing. I have class A that do something (for example counts something ). There is also one class B that handle some parameters to this class (class A is member of ...
2
votes
3answers
515 views

Is C++0x Compatible with C?

I have heard that there will be a lot of changes done in C++ because of the new standard (C++0x). My question is: What are the major changes, and will C++0x be compatible with C++ 98 and C ?
1
vote
2answers
84 views

Initialization of objects in a system using dependency injection

This is a follow up question to the following post: Injecting dependencies (DI) in c++ applications In a system that uses DI, someone, somewhere should be responsible to create the various objects ...
1
vote
1answer
599 views

Big project with many external libraries - source code organisation

I was wondering what is the best way to organize my source code. I was researching on SO and found http://stackoverflow.com/a/1398594/137261 but this source code layout is library specific and doesn't ...
1
vote
3answers
618 views

Pattern for Accessing MySQL connection

We have an application which is C++ trying to access MySQL database. There are several (about 5 or so) threads in the application (with Boost library for threading) and in each thread has a few ...
0
votes
3answers
275 views

C/C++ in applications that do not concern performance [closed]

C is the best language (or maybe the single language) suitable for operating systems, drivers, embedded systems etc. For more complex domains like computer graphics C++ is a better choice. But these ...
-5
votes
2answers
7k views

How do I easily print number triangles? Using for loops [closed]

I know how for loops work and what a nested loop is but I get very frustrated while printing those number or asterisk triangles in java. It makes me wanna quit learning programming :( Please someone ...