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

learn more… | top users | synonyms

0
votes
1answer
752 views

Should I use webKit or is there a better technology to make a browser in Windows [closed]

I create web applications most in RoR and PHP. About a year ago a company wanted to use my app but in a stand alone browser window in Linux, so I wrote one in python using webkit, locked it down to ...
3
votes
5answers
2k views

Programming Style in Large Scale C++ Applications

Recently I've been browsing source code of large applications written in C++ to learn a bit but I couldn't help but notice that most if not all use a lot of IFDEFs and class-less functions (where they ...
16
votes
13answers
2k views

Is it an appropriate use of #define to make typing repeated code easier?

Is there any view on whether using the #define to define full lines of code for simplifying coding is good or bad programming practice? For example, if I needed to print a bunch of words together, I'd ...
10
votes
8answers
1k views

Is writing software easier than reading and understanding it from scratch? [closed]

Me and a friend of mine were discussing yesterday about differences between writing a large C++ software and understanding it as a new recruit. Is it possible that since a software gets done one line ...
0
votes
2answers
113 views

I'm trying to figure out which functions from one C library are being used by C project. Does anyone have a simple solution? [closed]

To be specific, I want to know which function/types in libpri and being used in the Asterisk project. I'm not traditionally a C programmer, but I know some basic stuff because I took a class in ...
2
votes
2answers
402 views

C++ Using Intrinsics in a Cross-platform Manner

I have a cross platform math library that I am working on and I want to make sure that some common operations are performed in an optimized manner, so I wish to use some intrinsic functions wrapped in ...
6
votes
3answers
1k views

Is relying on implicit argument conversion considered dangerous?

C++ has a feature (I cannot figure out the proper name of it), that automatically calls matching constructors of parameter types if the argument types are not the expected ones. A very basic example ...
7
votes
3answers
378 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.
1
vote
1answer
519 views

Balance Tree with depth n has how many nodes maximum?

I couldn't find the answer anywhere, but let's say we have a B-Tree with min = 1 and max = 2: What is the formula to calculate the maximum number of nodes in this B-Tree if the depth is say 100? This ...
7
votes
3answers
810 views

Is it recommendable to program .net apps with C++

From what I can understand, C# is the defacto language when coding .NET apps. Is it recommendable to program .NET apps [let that be ASP.NET, WinPhone 7, GUI, etc] in C++? What are the pitfalls and the ...
2
votes
2answers
718 views

How to port cli c++ program with GNU libraries from windows to Linux

I need to implement some graph partitioning algorithms for my thesis. I have mostly Windows experience. I would like to know if it is hard to migrate c++ console program to Linux. I want to program it ...
2
votes
2answers
430 views

Recompiling dll's and adding more during run time - what are my options?

I want to compile custom functions during run time based on user written scripts. I'll give a hypothetical example that should demonstrate exactly what I need to do. This is the best way for me to ...
11
votes
4answers
2k views

Is it possible to use the Intel C/C++ compiler on Linux to create object files to be linked on Windows?

Why? Depending on your source the Intel compiler is likely or most definitely the compiler generating the fastest executables for the x86 architecture (5 to 100 % execution time improvement). Intel ...
19
votes
6answers
1k views

A programming language that allows you to define new limits for simple types

Many languages like C++, C#, and Java allow you to create objects that represent simple types like integer or float. Using a class interface you can override operators and perform logic like checking ...
2
votes
3answers
10k 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 ...
9
votes
3answers
834 views

C++ 'using': Should I use it or should I avoid it?

I realize there are subtly different semantics for some of these, because of ADL. In general, though: Which one should I prefer (if any), and why? (Or does it depend on the situation (e.g. inline ...
2
votes
3answers
1k views

How does a new programmer plan a code? [duplicate]

I've been learning programming on and off for the past 3 years never dedicating any meaningful amount of time until recently. Something that has confused me about programming is: How do you start ...
0
votes
2answers
281 views

The best way of coding web system in term of performance [closed]

So far I've been using IPB and my custom scripts all coded in PHP but I am really disappointed of the long term performance of it. I would like to move to native coding, the learning time to put into ...
5
votes
7answers
1k views

Ensuring that headers are explicitly included in CPP file

I think it's generally good practice to #include the header for any types used in a CPP file, regardless of what is already included via the HPP file. So I might #include <string> in both my HPP ...
41
votes
3answers
11k views

Can somebody explain me what are lambda things in programming?

So far I heard about : Lambda calculus Lambda programming Lambda expressions Lambda functions Which all seems to be related to functional programming... Apparently it will be integrated into ...
1
vote
2answers
1k views

Why is C++ preferred over C for commercial applications? [closed]

I program in C mostly. However, it is pretty obvious that many more commercial applications are done in C++. As far as I can tell, C++ is a very complex language, with seemingly convoluted syntax and ...
1
vote
1answer
322 views

Portability: Python's C/C++ libraries/extensions vs JRuby's Java libraries

I've had some discussion with colleagues who chose to go with JRuby along the following line of argumentation: JRuby can make use of anything that is available in Java, ergo such programs are more ...
3
votes
4answers
605 views

Initializing derived classes in the same way

I have a class Base that has several children, say A, B, C. For testing purposes I'd like to mock those derived classes by deriving from them. So MockA derives from A, MockB derives from B and so on. ...
28
votes
8answers
16k views

Are C and/or C++ viable/practical options for web development? [duplicate]

I am proficient in C, and I am learning C++ right now. I always played with websites (HTML/CSS), and I was wondering if it would be viable/practical to create some simple web apps using C and/or C++. ...
8
votes
2answers
1k views

Would Task-based programming in C++ require new language standard features?

So I saw this video on Youtube with all these C++ masters on GoingNative 2012 : Interactive panel where everybody could ask the questions. This is the video I was talking about: GoingNative 2012 - ...
0
votes
2answers
1k 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 ...
-3
votes
2answers
417 views

Why do people tend to gravitate to older versions of visual studio? [closed]

I'm starting to pick up all of the perks of C++11, and being a 2010 user i'm considering installing 2012 instead for better c++11 support. But why is it that 2012 doesn't seem as popular as 2010? Am i ...
11
votes
6answers
1k views

What is your opinion of C++ Frequently Questioned Answers? [closed]

Do you think that the criticisms in Frequently Questioned Answers are accurate?
28
votes
8answers
4k 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 ...
3
votes
1answer
447 views

Arithmetic coding issue

Since a few days I am fighting my way through implementing arithmetic coding. I found a really great source of information which made me understand how it should work. Long story short, it implements ...
1
vote
1answer
556 views

Qt solutions have been re-licensed, can I use the src directly now

I have a commercial application that uses a Qt Solutions component. Until recently, this component was licensed under the LGPL license, so I was forced to use the component in the form of a shared ...
1
vote
2answers
432 views

Statistics collection engine for C++ systems

We have a research project with idea->prototype->statistics development cycle. Anyway, our final product is a prototype, so the statistics collection suite is not used persistently. Supposing I have ...
0
votes
3answers
3k views

Two-Dimensional vector in C++ – inefficient with dynamic-sized sub vectors?

I know that std::vector uses a contiguous block of memory, but I often see people use vectors of vectors, even when they modify the number of elements in these vectors contained within an outer ...
1
vote
2answers
2k views

Best practice for creating a 'global' config class used by numerous components

I have a large project with a driver part and about 5 libraries doing various associated tasks. Many of the libraries require access to 'global' configuration data which is read from a database at ...
6
votes
5answers
1k views

Spoiled by Python convenience- and productivity-wise, spoiled by C++ speed-wise. Now unhappy with both [closed]

I'm currenetly struggling with choosing how to proceed as a programmer. I mainly programmed games and would like to continue. And for about 5 years or so I just used C++ and OpenGL, so I spent a lot ...
-1
votes
4answers
2k views

C++ or C#: Which language is Microsoft going to use in development of future Windows versions? [closed]

I heard almost all parts of Windows are written in C and C++ with some assembly. Why did Microsoft skip C#? Is there any scope for C# in the development of future Windows versions?
9
votes
4answers
976 views

Why do some programmers categorize C, Python, C++ differently? - regarding level [duplicate]

I am taking an introductory course on python and the instructor says that python is a high level language and C and C++ are low level languages. It's just damn confusing. I thought that C, C++, ...
7
votes
7answers
2k views

Why c++? Where to start? [closed]

I know there was many questions like this one, but please hold on one more. All programming languages I know now are made for web purposes. I've been learning ActionScript, php and a bit of ...
1
vote
1answer
480 views

Decrement operator difference between C++ and Java? [closed]

Please tell me why the same piece of code behaves differently in C++ and JAVA. Ok first I implement a function to calculate the factorial of an Int RECURSIVELY In JAVA: int f(int x) { ...
-2
votes
1answer
1k views

Is C a pre-requisite in order to learn C++ effectively? [duplicate]

I only have programming experience with high-level languages, as well as with DBMS. Now, I would like to get into C and/or C++. My question is: Is the C language a pre-requisite in order to learn C++ ...
1
vote
5answers
553 views

Is it possible in C++ to define several methods at once?

Sorry for the confusing title of this question, but I can't think of an exact way to word it. I have a very long class with hundreds of similar methods and I am trying to find a way to construct it ...
0
votes
1answer
227 views

Did I answer this correctly and concisely? [closed]

By email I just answered my brother who is learning computer programming that C++ and Java are more similar than C and C++ even though C++ is nearly a superset of C. Do you agree? AFAIK Stanley ...
0
votes
1answer
616 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 ...
-3
votes
1answer
535 views

how to Read in a list of values store it in a queue and change the order of the inputs? [closed]

How to Read in a list of values store it in a queue and change the order of the inputs? For example, read in abc123efgh45678 and display a1b2c3d4e5f6g7h8 I know I can use queue to read in the ...
-2
votes
1answer
3k 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 ...
3
votes
3answers
387 views

Is there a way to use a higher level language in a competition that only has C, C++ and Java by default? [closed]

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. ...
5
votes
2answers
885 views

Efficient Data Structure for holding a graph

Problem Link - http://opc.iarcs.org.in/index.php/problems/NUMTRIPLE In my opinion, the problem can be solved by a data structure, that shows how each number is connected to another, and via recursion ...
11
votes
2answers
9k 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 ? ...
5
votes
4answers
11k 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. ...
8
votes
2answers
790 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 ...