Questions tagged as 'c++'

3
answers

Why is not it a good practice to use namespace "std" in C ++?

I was using using namespace (nomeDaBiblioteca); in my code and I ended up having some conflicts with another library. Why do these conflicts happen and what is the best solution?     
asked by 28.10.2014 / 19:02
2
answers

How to use Qt translations directly with QApplication :: tr ()

In an application developed in Qt I have a non-visual class (that is, it is not inherited from a QWidget ) but it handles text strings that must be presented to the user. To use the Qt translation engine, I defined all strings using the...
asked by 11.12.2013 / 18:59
4
answers

Is it possible to develop websites with C / C ++?

I know a bit of PHP, but I see that on content sites, sometimes it fires and so on. Researching, I have seen (very shallow) reports that it is possible to develop web applications with C / C ++, and that these, in turn, would have far more pe...
asked by 15.12.2016 / 10:15
3
answers

Why local variables are avoided in Arduino?

In several code examples for the Arduino, I note that there is almost no use of locally scoped variables. One of the examples in the IDE: Analog > AnalogInput : int sensorPin = A0; int ledPin = 13; int sensorValue = 0; void setup()...
asked by 24.12.2013 / 14:21
1
answer

Compiling C ++ using Gradle

Gradle is a great ally in both java and android development. I was looking at the site and realized that it can also manage projects in C ++. How can I use it to compile a super simple project (hello word)?     
asked by 05.01.2016 / 19:47
1
answer

Waiting for a signal inside a QQuickImageProvider

I'm creating an application using QML and Qt 5.2 . In it a ListView displays multiple items, each with an image and associated text. The image is built based on data uploaded from a server by HTTP . In a simplified way, I have the fol...
asked by 23.01.2014 / 15:12
2
answers

Fork in Windows

There is something in Windows like (or some similar alternative to) fork POSIX systems (UNIX and Mac) to create a child process that is an exact copy of the parent and runs from the calling point? As far as I know CreateProcess...
asked by 05.03.2016 / 00:58
1
answer

Compiling on your computer actually improves performance?

Any programmer knows that when compiling a C / C ++, the compiler can optimize code to generate faster executables. But, it's also said there is compiler optimization for your processor. This means that if I created a C program and compiled i...
asked by 17.05.2014 / 10:01
2
answers

What is the difference between * var ++ and * var + = 1?

I am writing a function with the signature: int increment(int *val) . My intention is to get an integer pointer, increment its value in 1 and return that value. The body of my function was as follows: int increment(int *val) { *...
asked by 22.11.2015 / 18:35
2
answers

What is the use of pointers?

What is the use of pointers, for example: int var; int *p; int **pp; var = 50; I even understand the use of the simple pointer (*), but why use another to reference this?     
asked by 14.07.2014 / 20:12