Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
4
votes
3answers
4k views

What is a good workflow for a C++ beginner?

I desire to become a more serious scientific C++ programmer. To do so, I need a consistent style of workflow (e.g., coding, test-driven development, etc.). My question is simply what sort of ...
5
votes
4answers
745 views

Why do we love using i? [duplicate]

Possible Duplicate: Why do most of us use 'i' as a loop counter variable? Maybe this questions seems to be extreamly stupid but I wonder why we use i as variable in most cases in for ...
18
votes
3answers
2k views

Advantages of a left to right language syntax

I've been watching an interview with Herb Sutter on Channel9 and he mentioned at the end of the video that left to right language syntax would be on the top on his whishlist for a future C++ standard(...
58
votes
11answers
16k views

A modern review of Java [closed]

I've been programming for a few years and I began in Java, and in my time I've found many different sources claiming Java to be an inferior language in some way or another. I'm well aware that each ...
21
votes
4answers
2k views

Given C++ '11 Was Approved, Does This Change How A C++ Beginner Learns The Language? [closed]

I've wanted to learn C++ for awhile and took AP Computer Programming in High School (back when it was C++ and not Java). I enjoy C and just haven't found the time to learn C++ or I'll just fall back ...
4
votes
3answers
2k views

Will there be any official LINQ like lambda based library for C++? [closed]

Given C++ gained lambdas with C++11, will there be any LINQ like higher order function library officially supported later? Or is there already such a library used in production quality code? ...
2
votes
3answers
722 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 ?
8
votes
1answer
6k views

Parallel programming library? (+ some features)

Note: this is a reposting as the question has been considered non-suitable for the Stack Overflow forum and should have been posted here. The original topic is there. I'd like to talk of ...
3
votes
5answers
2k views

function pointers are so complex to me

I found this code sample in this answer by Armen Tsirunyan. class MyClass { public: typedef void (*funcPtr)(int, int); MyClass(funcPtr whatToCall) { callme = whatToCall; } ...
0
votes
2answers
2k views

How do i put my head around ISAPI Filters

I am a newbie. I have decent command over C++ but i lack domain knowledge when it comes to servers and stuff. My current assignment is to write ISAPI filters for IIS Web Server. I have been googling ...
2
votes
3answers
2k views

What are pros and cons of using temporary "references"?

In C and C++ (and I guess other languages that allow taking a "reference" to an array element or something similar), when you have an array like type, accessing individual elements of such an array ...
4
votes
3answers
4k views

distribution of programming languages in embedded systems

I am looking for statistics concerning the distribution of programming languages in the embedded sector. Do you know any good websites, articles or books? I found this as a first reference but am ...
21
votes
9answers
2k views

Good design: How much hackyness is acceptable? [duplicate]

Possible Duplicate: Prototyping vs. Clean Code at the early stages I'm right in front of a difficult decision. I have a problem in my codebase (it's in C++), which I could solve in two ways: A) ...
64
votes
13answers
9k views

Philosophy behind Undefined Behavior

C\C++ specifications leave out a large number of behaviors open for compilers to implement in their own way. There are a number of questions that always keep getting asked here about the same and we ...
1
vote
3answers
3k views

declaration and definition

People say definition is used when the declared stuff has some memory allocated. If I declare a class class fish { char* name; int type; //someting i dont know about fish }; int main() { ...
11
votes
1answer
7k views

What is "friend" keyword used for?

Can you explain to me why the friend keyword is preferred for giving access rights to private data of class?
9
votes
2answers
3k views

Build automation: Is it usual to use QMake for non-Qt projects?

So, I'm planning to write a C++ library and I want it to be cross-platform, and as this library won't deal with UI and I want it to have as little dependencies as possible, I won't be using Qt (...
13
votes
9answers
2k views

Rewriting IBM assembler + COBOL in C++

I work as a rental agent / manager for a car rental company that is running on a rental system that was written in 1972. I decided that maybe it was time for an update. For a bit of background, here ...
2
votes
1answer
773 views

Database with version history?

I'm developing a game with a component-based architecture. I want to store entity descriptions in a SQLite database for compactness and convenience. Obviously the backend code is (and the database ...
2
votes
3answers
3k views

Design choices when doing multithreading in C++

OK, so, background: I have a little "server" app/module that is written in C++. This is kindof a tunnel application that provides a standardized API via TCP/IP[a] and on the other hand talks to the "...
6
votes
2answers
10k views

xml parser vs JSON parser performance in Java / C / C++

I am trying to understand which data format is better on embedded device communicating with Server over REST API. XML or JSON?. Is JSON parsing faster than XML parsing in Java / C and C++? I ...
16
votes
5answers
8k views

Can someone explain how a GUI works and when I should start using one? [closed]

I've been learning C++ for about a month now, and before I go any further, I'd like to clear up this tedious question I keep on having. I know what a GUI is, but I don't really know how it works, and ...
199
votes
40answers
20k views

My Dad is impatient with the pace of my learning to program. What do I do? [closed]

So my Dad bought me 5 books on programming (C++, Java, PHP, Javascript, Android) about a month ago. He's an architect and he knows NOTHING about programming. He bought me them because I told him ...
1
vote
3answers
272 views

Documentation: What is "appropriate" when expressing a valid range for a parameter?

What is the appropriate method to describe a valid range of a parameter in the documentation of code? Obviously long-form documentation (white papers, API documents, etc) can be more verbose than the ...
53
votes
11answers
20k views

What are the best practices regarding unsigned ints?

I use unsigned ints everywhere, and I'm not sure if I should. This can be from database primary key id columns to counters, etc. If a number should never be negative, then I will always used an ...
23
votes
7answers
19k views

If a variable has getter and setter, should it be public?

I have a class with a variable that is private and the class has a getter and a setter for that variable. Why not make that variable public? The only case I think you have to use getters and setters ...
12
votes
3answers
5k views

Class Versus Struct

In C++ and other influenced languages there is a construct called Structure (struct), and another called the class. Both are capable of holding functions and variables. Some differences are: Class is ...
135
votes
8answers
90k views

What does C++ do better than D?

I have recently been learning D and am starting to get some sort of familiarity with the language. I know what it offers, I don't yet know how to use everything, and I don't know much about D idioms ...
20
votes
8answers
1k views

Dealing with coworkers when developing, need advice [closed]

I developed our current project architecture and started developing it on my own (reaching something like, revision 40). We're developing a simple subway routing framework and my design seemed to be ...
2
votes
3answers
1k views

GUI: Setting options in two different places and having them stay in sync?

Programming in Windows with Visual Studio 2010 C++ and MFC. My question is about how best to store, update, and pass around program settings or options. I have a simple main GUI window/frame/dialog. ...
12
votes
12answers
27k views

Why is C++ often the first language taught in college? [closed]

My school starts the computer science curriculum with C++ programming courses, meaning this is the first language that many of the students learn. I've seen that many people dislike C++, and I've ...
11
votes
3answers
4k views

generic programming, how often is it used in industry

I do programming in an academic setting at the moment, so I can use whatever I want. I'm using the boost graph library for a few things, and I'm wondering whether investing effort in understanding GP ...
4
votes
2answers
2k views

Which tools to use for Embedded Linux C++ development with a fast compiler and possibly cross platform [closed]

I'm not happy with our build environment for our Linux based (Ubuntu 10.04) equipment. It is embedded software we are developing. What I would like is to have the optimal mix of these wishes: Use ...
6
votes
12answers
3k views

Language Choice for Algorithm Competitions [duplicate]

Hi everyone I have just started taking part in online coding competitions.I would like to know which language would be better as regards efficiency and ease of debugging. I tend to avoid c++ and ...
10
votes
5answers
5k views

Monitoring C++ applications

We're implementing a new centralized monitoring solution (Zenoss). Incorporating servers, networking, and Java programs is straightforward with SNMP and JMX. The question, however, is what are the ...
15
votes
6answers
3k views

How to hire a good C# developer if I don't know C#? [closed]

I'm a C++ developer. I know how Windows works on the native level, but I'm not a big expert in C# and .NET. Now I need a C# developer in my team (all my developers are C++). How can I hire a great C# ...
36
votes
7answers
20k 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 ...
12
votes
9answers
936 views

Inheritance gone wrong

I have some code where a good inheritance model has gone downhill and I am trying to understand why and how to fix it. Basically, imagine you have a Zoo hierarchy with: class Animal class Parrot : ...
1
vote
1answer
421 views

Designing classes containing the same objects but different amount of them

I am creating a main object, MACHINE, which will contain a diversity of several other objects -- AXIS, AMPLIFIER, ENDEFFECTOR, etc. The number of contained objects will vary depending on the MACHINE ...
8
votes
8answers
7k views

What is beautiful code in C++, and why do most programmers care that much? [closed]

As most projects use a C++ API, they deal with constraints of the API and constraints of the project itself. I'm a beginner at programming, I don't like to use OOP at all because nobody clearly ...
2
votes
3answers
283 views

What are the various premature optimizations traits / types?

For code review technique training, I have to cover various topics. One of them is premature optimization. I found 3 traits of it as: It's generally evil; causing inverse effects. It's an unnecessary ...
2
votes
1answer
519 views

How do you handle multiple projects that form the same product(s)?

I have limited experience when it comes to build and version control systems. I feel like I've run into a common problem but I'm having trouble uncovering how it is typically handled. Say you have ...
1
vote
2answers
121 views

How to gradually improve on an old IBM Host C++ framework

Imagine a C++ framework as a business layer, but with controlling logic as well. E.g. user rights, state of the webflow etc. With some plain C code to access DB2. The whole framework is host based. We ...
1
vote
1answer
641 views

Reading a character from a file stream in c++ (AKA: Why no C++ standard equivalent of old conio.h)?

This is a question of about design decisions. I find that there are so many different things I work on where reading a _kbhit() is amazingly useful but I can't find (read: there isn't) any ...
8
votes
5answers
2k views

What one should look for when choosing a cross-platform C++ GUI library?

As a learning C++ programmer, I am trying to select a GUI framework or library for my own projects. I have some experience with Qt: it's very straightforward, it has a very good documentation, and ...
22
votes
5answers
18k views

Whether to use -pedantic flag in g++ or not?

I'm learning C++ and I'm using g++ on Linux for practicing. I want to know if people working as programmers use g++ -pedantic flag and also its importance in real world. What about other compilers, ...
3
votes
1answer
288 views

Will the portions of Boost that are incorporated into the new C++ standard continue to be developed?

What will happen to the portions of the Boost library that are incorporated into the new C++ standard? Will they continue to evolve and any changes be reincorporated into the standard which follows ...
1
vote
6answers
3k views

Java API vs. Other APIs [closed]

I'm more at the novice end of the software developer spectrum, but nevertheless I've had exposure to quite a few programming languages and frameworks. From all the technologies I've used, I haven't ...
12
votes
2answers
24k views

Understanding Backtracking in C++

I have a good basic understanding of the fundamentals of C++, I also have an understanding of how recursion works too. I came across certain problems like the classic eight queens problem and solving ...
37
votes
9answers
6k views

Is possible to write too many asserts?

I am a big fan of writing assert checks in C++ code as a way to catch cases during development that cannot possibly happen but do happen because of logic bugs in my program. This is a good practice in ...