Questions about C++, a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.
-3
votes
0answers
122 views
Visual C++ coding like a NINJA? [closed]
Please view this short youtube video:
http://www.youtube.com/watch?v=MeqRo6HvtUU
skip to 33 seconds
How to make that "auto-replace" feature in Microsoft's visual c++? So that when I type something ...
-2
votes
1answer
256 views
How can I learn to like C++? [closed]
I'm a wimpy web programmer by trade -- I enjoy programming in JavaScript, CoffeeScript, TypeScript, and Ruby.
I have to program in C++ for my computer science degree, and it frustrates me. I don't ...
-2
votes
1answer
182 views
Passing data between two windows forms using visual c++ 2010 [closed]
So, i have a simple forms application : i have a form 1 (Form1.h) and a second form (Form2.h).
Form1 consists of a simple Add User button(which at this stage does nothing but opens the form2 and ...
4
votes
3answers
321 views
Is there a way to use a higher level language in a competition that only has C, C++ and Java by default?
On that competition, you gain access to a system with gcc, vim, emacs and Java. You can't take any file with you and there's no internet access, but you can do whatever you want inside that system. ...
0
votes
0answers
257 views
How to stay up to date as a programmer and developer [duplicate]
So I am going to college right now for computer science, and I am reading a lot of books on different languages that have nothing to do with my courses in school, and I found out that I am completely ...
23
votes
8answers
2k views
Is the algorithm more important than the programming language?
During the current (2013) Google Code Jam contest, there was a problem that took C++ and Java people 200+ lines of code as compared to Python people that solved the same problem only using 40 lines of ...
4
votes
3answers
213 views
How hard is it to migrate if one has practiced C/C++ only on Windows & never in Unix-like OSes like Linux? [duplicate]
I was confused about whether to post it on Meta or here, but then decided the latter. In compliance with SO T&C, I don't intend to debate which is better. I only need an objective & technical ...
-1
votes
0answers
112 views
'delete' operator in dynamic memory allocation [closed]
In c++, I know that when a memory space is deallocated with a 'delete' operator and then one try to fetch what the pointer points to after the deletion, it always gives an unpredictable output. ...
0
votes
4answers
225 views
Forward declaration vs include
Reduce the number of #include files in header files. It will reduce build times. Instead, put include files in source code files and use forward declarations in header files.
I read this in here. ...
0
votes
1answer
89 views
implementing asychronous udp socket in c
so far I've been trying a single server+single client udp chat application where both server and client should be able to communicate with each other freely(as in regular chat applications). for this ...
3
votes
2answers
524 views
Why is C so high in TIOBE index of popularity, while C++ is just under here too, but not as popular? [closed]
I can't get my head around this. If C is so much used, but C is not C++, can someone explain to me the most important reasons that makes C more used than C++ ? Where is all this C code written for ?
...
7
votes
2answers
258 views
How do I avoid writing lots of pass-through functions in a wrapper?
I have a class, which wraps another class of a common base type. Because the base type interface is quite large this involves writing a lot of pass-through functions. I am looking for a way to avoid ...
1
vote
2answers
213 views
Why can't we declare 'extern C' for C++ macro's?
I am new to C/C++. Wanted to know why we cannot declare 'extern C' for C++ macro's similar to methods/functions...which will allow macro's defined in C++ file to be accessed in .c files.
Thanks in ...
6
votes
3answers
349 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 ...
0
votes
1answer
189 views
Nested classes vs namespaces
Is it good to use nested classes or should I use namespaces instead?
In context:
I have a templated codec loader and a codec have In objects and Out objects
template<class TypeOfData>
class ...
0
votes
0answers
5 views
C union char array prints 'd' on mac? [migrated]
I am new to C/C++, but was curious to know about the issue i am seeing.
typedef union
{
int a;
float c;
char b[20];
}
Union;
int main()
{
Union y = {100};
printf("Union y :%d - %s - %f ...
-4
votes
0answers
142 views
Programmer's career and Call of C++ [closed]
I'm a .Net developer, mostly in C#. Now I'm working on enterprise solutions in a company and can be counted as respected.
But the problem is that isn't enough for me. I'm not good in computer science ...
-5
votes
3answers
116 views
is solving these kind of problem important in programming [duplicate]
We're learning C++ at school, we got to for, while etc.
We always keep having questions like
Make a program that get the next output and use for in it
1 3 5 7 9 11
Would it be a problem if one ...
2
votes
0answers
47 views
How to format complex number output with negative or zero values [migrated]
Please I need to write a program that takes two complex numbers from the user and output their difference. Complex numbers are those numbers in the form of a+bi, where a and b are real numbers known ...
11
votes
4answers
889 views
Why is sizeof called a compile-time operator?
Originally, this is a part of another question.
Why is sizeof called a compile-time operator? Isn't it actually a run-time operator? And if it is indeed a compile-time operator, how does it help in ...
3
votes
3answers
273 views
Understanding stack frame of function call in C/C++?
I am trying to understand how stack frames are built and which variables (params) are pushed to stack in what order? Some search results showed that the C/C++ compiler decides based on operations ...
0
votes
2answers
150 views
unique_ptr and references - coding style question
I'm pretty sure this is a question purely about aesthetics but I wanted to get all your opinions on it before I start proliferating this type of code in my codebase. Consider the following code:
...
0
votes
1answer
178 views
Teaching `class`es and objects in C++ to university students
To learn classes and objects at my university, students are required to develop a simple game (nine-mens morris or something similar) using Java. Java is used because of its libraries and tool ...
0
votes
2answers
190 views
How to find local maxima in matrices?
I need to develop an algorithm for finding all the local maxima in a two-dimensional array: how to search for local maxima in the the most efficient way? Are there algorithms about it?
Moreover, the ...
9
votes
4answers
551 views
Will working in IT limit your career prospects as a programmer? [duplicate]
I took a job working as an IT guy (SQL programming, helpdesk, etc.) because I had need of a job (to pay back student loans accumulated from school).
I'm very happy to have a job, but I eventually ...
0
votes
0answers
152 views
How GUI toolkits are made for c++?
Like GTK and wxwidgets, im having a hard time wrapping my head around it, ive looked at the source code of wxwidgets and i see no windows api functions in sight, i would like to just create a custom ...
0
votes
2answers
376 views
0
votes
3answers
307 views
Design for multiple type return
I am working in C++ and I have this problem.
class Container {
Container(int which_type_to_use_a_b_or_c);
A & getData(A & prototype);
B & getData(B & prototype);
C & ...
2
votes
1answer
215 views
How to see bits of an integer in Visual Studio
As far as I know it is not possible to see the bits of an integer in Visual Studio, you can see variables in decimal or hexadecimal format in the Locals and Watch windows in the debugger.
Why is this ...
7
votes
2answers
266 views
Using scoped enums for bit flags in C++
An enum X : int (C#) or enum class X : int (C++11) is a type that has a hidden inner field of int that can hold any value. In addition, a number of predefined constants of X are defined on the enum. ...
2
votes
0answers
108 views
Using absolute paths for build dependencies
Currently we use Source Safe and start migration to Subversion.
All external SDK(> 500 MB) hold in Source Safe now, and I look for way to move them from VSS
to some repository.
We have C++ (mostly), ...
7
votes
1answer
196 views
Database Facade to wrap our existing queries?
We have a very big application written in C++ using the MFC framework (millions of code lines). No need to say that it's a legacy system, but it's also heavily maintained and updated. This application ...
0
votes
2answers
470 views
Choosing between Qt/C++ and .NET/C# [closed]
I have a desktop project I've been working on for a couple months that I want to run on Windows and Mac. When I started the project, I started writing it in Qt 4.8 in C++. Development has gone fine ...
-2
votes
2answers
177 views
About Artificial Intelligence [closed]
I am interested in starting a career in artificial intelligence.
Can anyone suggest how I could prepare for this?
What languages should I study that would be best for this career choice?
10
votes
3answers
701 views
Why do books say, “the compiler allocates space for variables in memory”?
Why do books say, "the compiler allocates space for variables in memory". Isn't it the executable which does that? I mean, for example, if I write the following program,
#include <iostream>
...
2
votes
1answer
180 views
Using a development language (Python) before putting it into C++ [duplicate]
I'm kinda having a debate here with my friend, whether it's OK to have a development language before putting the idea into C++.
When I say development language I mean a language to try ideas out ...
1
vote
1answer
224 views
Performance overhead of standard containers and boost [closed]
Adap.TV has chosen C++ to develop their software. However, they've decided not to use the standard containers1 and boost for performance reasons, as they've blogged about it in the following article:
...
5
votes
2answers
178 views
+100
How to make support for bindings for a scripting language
Main
I'm making a scripting language using C++. I plan to use it with a simple test game editor. But I have to make a support for bindings to call game engine's nodes' methods to update positions, ...
0
votes
1answer
119 views
Having hard time outputing the Band Color from a known value of a resistor [closed]
I'm writing a simple program to convert a Resistance Value to it's corresponding color bands. I'm trying to think of the most efficient way that will be universal for 4,5 and 6 Band Resistors. ...
1
vote
3answers
392 views
The best way to store dictionary from file
I'm working on a translator in C++. Basically I want to parse the file with translations and store it in my program, so I can perform search through the words and simply access the corresponding word. ...
13
votes
5answers
801 views
Would it make sense to use objects (instead of primitive types) for everything in C++?
During a recent project I've been working on, I've had to use a lot of functions that kind of look like this:
static bool getGPS(double plane_latitude, double plane_longitude, double plane_altitude,
...
2
votes
1answer
127 views
LGPL, .lib, .dll, and linking
I am trying to build a project which uses an unmodified copy of libconfig (http://www.hyperrealm.com/libconfig/). libconfig is LGPL, but I don't want to open source any of my code. By my ...
0
votes
1answer
119 views
Converting 'char*' to 'char'. Am I passing this array correctly? [closed]
So my CS professor gave the whole class a simple assignment. "Write a recursive function that will swap the order of a section in an array of chars." I thought to myself, "Easy. I'll finish this up in ...
10
votes
2answers
521 views
Why can't a compiler avoid importing a header file twice by its own?
New to C++! So I was reading this: http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/
Header guards
Because header files can include other header files, it is possible ...
0
votes
4answers
403 views
Can one can survive in the IT industry without knowledge of C and C++? [duplicate]
I am just a graduate from India and I have knowledge of Java, JSP and Servlets, Android application development and some iOS development.
I do not have a background in C or C++ and a little weak ...
0
votes
1answer
153 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 ...
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 ...
4
votes
6answers
1k views
Stroustrup and the C++ complexity admission [closed]
I heard from a friend that Bjarne Stroustroup admitted that he doesn't know entirely the C++ programming language due to its vast complexity
Is it true and there's some referrable sources or is it ...
9
votes
4answers
621 views
C++ why & how are virtual functions slower?
Can anyone explain in detail, how exactly the virtual table works & what pointers are associated when virtual functions are called. If they are actually slower, can you show the time that the ...
0
votes
0answers
76 views
BucketSort Algorithm in C++ [closed]
can somebody help me fix my code? I've been trying to write the BucketSort algorithm in C++ code, but it doesn't seem to be able to output the correctly sorted array and I can't find my mistake.
...





