Questions tagged as 'c++'

2
answers

Struct or Classes?

I made the code using structure, wanted to know if classes would be more efficient. I'm doing it in C ++ Builder. The idea of the code is as follows: create a list of problems, where during the execution of the code will be added and removed num...
asked by 30.07.2016 / 03:14
1
answer

parameters for function: const reference and pointer for constant data

What is the difference in terms of performance (in the case of large object) the calls below: void funcao( const tipo &objeto ) and void funcao( const tipo *objeto ) I know that in the first one it receives a constant reference, w...
asked by 09.01.2017 / 19:09
1
answer

Qt Java - Get gallery image

I'm trying to get an image from the gallery of Android using Qt. I've already called intent of Java using a arquivo Java , but I do not know how to return the value to Qt. I have a class that calls a method in the Java file...
asked by 26.11.2015 / 17:43
1
answer

I want to display the number of negative numbers entered using functions

#include <iostream> #include <locale.h> using namespace std; int getnegativo(int a, int b); int main() { setlocale(LC_ALL, "portuguese"); int cont, cot=0; do { cout << "digite um valor: "; cin >...
asked by 01.11.2015 / 19:00
1
answer

Class functions hook (offset)

I do not know the right way to explain this, but I'll try it my way. I have an .exe application and I need to create some customizations for the executable, so I created a DLL and gave the hook so that the changes are loaded. By then, everyone k...
asked by 06.02.2016 / 01:21
1
answer

Decomposition in cousins

Hello everyone, I am learning C ++ for Data Structure and have some error in the code that is creating an infinite loop. #include <stdio.h> int fatores(int a[], int n, int *x) { int primo = 2; // primeiro primo int qtdzero =...
asked by 29.08.2015 / 22:45
2
answers

Code compilation [closed]

Please help me, I can not compile this code: Until the command prompt does not start anymore #include <stdio.h> int main() { int x,y,z; int a=0; for (x=0;x<=1;x=x+1) for(y=x;y<=1;y=y+1) for(z=y;z<=2;z=z+1)...
asked by 06.09.2015 / 02:54
1
answer

Explicit cast with "static_cast" does not occur

According to C ++ How to Program, 8th ed., during the operation of two numbers (eg 10/3) the fractional part of the result is lost before being stored in the variable. For this to be avoided, we can resort to explicit conversion using the stati...
asked by 20.07.2015 / 12:53
1
answer

Count the height and width of an "image" (char * using \ n) - C ++

Good evening! In one of the parameters of my constructor, I'm passing the following char * +---+\n|A |\n| H |\n| A|\n+---+ Next, the constructor calls SetText (), passing this char *, and within SetText (), I would have to count the hei...
asked by 01.12.2015 / 01:16
1
answer

Is this bubble sort correct?

People are reading C ++'s "Programming principles and practice using c ++ (2nd edition)" book. You have a good exercise at the beginning talking to make a program that orders the given numbers. I did it using BubbleSort, I burned a lot of neuron...
asked by 09.07.2015 / 19:13