Tagged Questions
0
votes
4answers
137 views
Char and unsigned char [closed]
Where is unsigned char used in C ( please tell about some real-world examples )? Why would we need both char and unsigned char?
Char ranges from -127 to 128 ( 8-bit integer )
Unsigned Char ranges ...
5
votes
3answers
467 views
Might starting variables/members with an underscore puzzle the compiler?
I've been taught since high school that defining variables like this:
int _a;
or
int __a;
should be consider bad practice because this would eventually puzzle compilers that use variables starting ...
7
votes
5answers
783 views
Is it a bad practice to include all the enums in one file and use it in multiple classes?
I'm an aspiring game developer, I work on occasional indie games, and for a while I've been doing something which seemed like a bad practice at first, but I really want to get an answer from some ...
1
vote
3answers
207 views
Programming C++ using Qt4 [closed]
Hey guys I am really new to the C++ programing I have a little knowledge in C and a bit more in C++, but I do not know them enough to call myself a programmer. I am working as a PHP Web Developer I ...
6
votes
2answers
215 views
What would be a non-contrived reason to have an object with Private Copy Constructor as well as Assignment Operator?
Looking for non-conceptual/non-contrived reasons of when one would need to use an object with both a private copy constructor and a private assignment operator?
As in what problem does this ...
1
vote
1answer
181 views
Knowing so much but application is a problem? [closed]
In my work, my friends always tell me, you know so much about computer science, electronics engineering,..etc. But I have difficulty in applying them and my code is crap.
How to solve that problem? ...
3
votes
6answers
645 views
Learning good OOP design & unlearning some bad habits [duplicate]
Possible Duplicate:
What books or resources would you recommend to learn practical OO design and development concepts?
I have been mostly a C programmer so far in my career with knowledge ...
4
votes
1answer
229 views
How to implement child-parent aggregation link in C++?
Suppose that I have
three classes P, C1, C2,
composition (strong aggregation) relations between P <>- C1 and P <>- C2, i.e. every instance of P contains an instance of C1 and an instance ...
2
votes
1answer
369 views
Using captured non-local variables in C++ closures
On this wikipedia page I have found the following sentence regarding closures in C++11:
C++11 closures can capture non-local variables by copy or by reference, but without extending their ...
1
vote
2answers
452 views
How do you accept arguments in the main.cpp file and reference another file?
I have a basic understanding of programming and I currently learning C++. I'm in the beginning phases of building my own CLI program for ubuntu. However, I have hit a few snags and I was wondering if ...
2
votes
4answers
447 views
The benefits of using RAII in C++
Suppose I'm a teacher and I want to explain to my students what are the benefits of using RAII in C++: I need a very good example, full of details, but that is easy to understand.
Which approach ...
10
votes
4answers
521 views
Motivation and use of move constructors in C++
I recently have been reading about move constructors in C++ (see e.g. here) and I am trying to understand how they work and when
I should use them.
As far as I understand, a move constructor is used ...
7
votes
3answers
369 views
Interfacing application code with unit tests
I am working on a project in which we have to implement and unit test
some new module.
I had a quite clear architecture in mind so I quickly wrote down the main
classes and methods and then we started ...
10
votes
2answers
750 views
Best overview to modern C++ paradigms?
I used to write C++ extensively between 8 and 10 years ago. I have since moved on to C# for professional reasons. However, from time to time I see statements like
"If you're still manually ...
4
votes
5answers
258 views
variable comparison without initialising
I am working with a project in VC++ which involves co-ordinate system having x,y,z axis.
I am trying to check for if a variable(Point with x,y,z values) is assigned on the coordinate system or its a ...
3
votes
2answers
400 views
Lazy Processing of Streams
I have the following problem scenario:
I have a text file and I have to read it and split it into lines.
Some lines might need to be dropped (according to criteria that are not fixed).
The lines ...
4
votes
6answers
651 views
Why is C++ backward compatibility important / necessary? [closed]
As far as I understand it is a wide-spread opinion within the C++ community that certain features of C++ (including some features inherited directly from C), while still usable in themselves, do not ...
19
votes
11answers
2k views
typedefs and #defines
We all have definitely used typedefs and #defines one time or the other. Today while working with them, I started pondering on a thing.
Consider the below 2 situations to use int data type with ...
5
votes
8answers
858 views
Why has the rate of programming language popularization slowed down in recent decades? [closed]
If I understand correctly, there was a huge birth of programming languages during the early decades of computing, but then things have stabilized.
Basically, why are many universities and industries ...
15
votes
10answers
1k 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 ...
4
votes
2answers
492 views
Do you use automatic garbage collection with standard C++?
I'm interested in a rough measure (percentage-wise) of how many use garbage collection, such as the Boehm collector, with standard C++.
Under what circumstances would you use garbage collection, and ...
13
votes
7answers
669 views
How did you become a const correctness convert?
After 15 years of C++, I've still haven't learn to love using const. I understand it's use, but I've never actually been in situation where being const correct would have avoided the problem I was ...
