Most voted "c++" questions
C++ is a typed, compiled, multi-paradigm, intermediate level, and general purpose programming language. It should not be confused with the language C. It was developed in the early 1980s by Bjarne Stroustrup as an extension of C. Its evolutionary features include type checking, support for automatic resource management, object orientation, generic programming and treatment of exceptions, among others.
Learn more…2,348 questions
Sort by count of
-
1
votes0
answers28
viewshow to change include references in classes created by Qxorm Editor?
I started today programming using Qxorm for persistence layer for testing, and as I use the eclipse for all my projects, I immediately created a first test project importing into Eclipse. But the…
-
1
votes1
answer139
viewsUse of delete Function - Inheritance of a Qlist
When compiling I get the following error, in Qlist. I’m using Qt 5.6. error: use of Deleted Function 'Vitamin::Vitamin(const Vitamin&)' Current->v = new T(*reinterpret_cast(src->v));…
-
1
votes1
answer29
viewsVector sorting of character vectors with qsort <cstdlib>
The following program is not ordering the chars vector correctly, but I don’t know why. Maybe it’s my auxiliary function "cmpstr" that isn’t returning the right value in some cases, or my qsort…
-
1
votes0
answers100
viewsError creating Windows Form in Visual Studio 2015 C++
created an empty project CLR ai went into project >> add new item>> UI >> Windows Form but he gives that mistake there, how to solve it?…
-
1
votes1
answer67
viewsResetting a Qabstractlistmodel
Would you like to know how to reset or clean data from a Qabstractlistmodel? I am using Qt version 5.6. The problem I’m having is when I try to perform an update of the information that is in the…
-
1
votes1
answer726
viewsDifference between recv and read, send and write
I am transmitting and collecting data from a connection using Sockets, to send the data to the server, you can use the commands send and write, and to receive the data recv and read. There is a…
-
1
votes2
answers365
viewsConvert Header C/C++ to Delphi
The intention is to consume a dll of biometrics http://www.veridisbiometrics.com/index.php/produtos/biometric-sdk-free I thought the best way would be to convert the headers they provide (not a good…
-
1
votes1
answer70
viewsI can’t get this program to work. It always says the numbers are divisible
#include <stdio.h> #include "funcao.h" int main () { int a, b; printf("Escreva os valores de a e b "); scanf("%d", &a); scanf("%d", &b); if (EDivisivel (a,b)) printf("sao divisiveis");…
-
1
votes1
answer72
viewsCompiler accuses typing error when there is no typing error
I have the struct struct no { int numero[2]; std::string nome; float valorDoNome; struct no *esq, *dir; }; struct no *raiz, *aux1, *aux2,*favoritos; The function { raiz->valorDoNome=0; int…
-
1
votes0
answers23
viewscmake source_group has no effect
I’m trying to organize the project generated in visual studio, for this I’m using the function source_group to add the directories I want, only it doesn’t seem to take effect: set(CPP_FILES_REGEX…
-
1
votes0
answers168
viewsHow to compile a . C/C++ on my website
Is there any way to compile a file. C/C++ within a website? let’s say a "file will be generated. c" and this file will be compiled... maybe you can do this in PHP or with some add-on.
-
1
votes3
answers5495
viewsDisplay the values of the c++ vector on the screen
I cannot list (display) the products registered in my Vector. Someone can guide me, I’m learning c++. #include<iostream> using namespace std; int main() { int op, i=0; string produto[10];…
-
1
votes2
answers7739
viewsHow to receive multiple values on the same line?
How can I receive multiple values on the same line? For example, the user enters the number of values and then the values: 5 (how many values greater than or equal to 4) -5 1 -3 5 7 (separated by…
c++asked 7 years, 11 months ago Gabriel Pastori 13 -
1
votes0
answers84
viewsHow to deactivate the full screen of another program?
For example, a game that is in full screen (With full screen do not mean maximized, but "even fullscreen"). How do I stay in window mode with C++ ? I’ve tried using "Sendmessage" : #include…
-
1
votes0
answers60
viewsColor of text in Qtableview
Hello, I am trying to implement text color in certain column of my Qtableview, unsuccessfully to paint the cell, just use the code below on my delegate that works: painter->fillRect(option.rect,…
c++asked 7 years, 10 months ago Juliano Gomes 69 -
1
votes1
answer390
viewsClone a struct without copying the memory address
I need to copy the struct problema1 to the struct problema2 , but to do the way it is in the program below , when I change the struct problema2 also be changing the struct problema1. The way I did…
-
1
votes1
answer131
viewsProblem configuring serial port on C++ on Linux?
Description: I have a problem that is the port of a code in C# to C++ does not work because of the serial port. I also noticed that on the /dev/ttyS0 device I am seeing the same bytes as in C++ and…
-
1
votes2
answers104
viewsProblems with extensive algorithm
I don’t know what to do, I think I made a mistake I don’t know. In my program the user must think of a number, and the computer must try to guess which number the user thought. The computer may ask…
-
1
votes1
answer815
viewsI’m having a problem with Dev C++ in displaying members of a class
To be more exact, when I press "." after some object, like I declare a vector: vector<int>Random; So far so good, so when I start typing: Random.push_back(); Dev c++ doesn’t help me complete,…
-
1
votes1
answer58
viewsSegmentation fault in client/server implementation
Hello, I’m implementing the game 21(Blackjack) in C++ in a Linux environment, During the execution it presents the error Segmentation fault, the problem is that I am not able to identify the error…
-
1
votes1
answer82
viewsQT - View Webcam on a Qlabel using another Thread?
Hello, I’m doing a C++ project using QT GUI. In the project in question I need to display images of a camera in the window, but in doing so, the performance of the window is very compromised, all…
-
1
votes1
answer4452
viewsWhat is the correct way to remove a vector element? C++
Could the way be the same to erase an integer vector, or an object vector? Every time an element is deleted, the vector position has to be changed ? The situation is the same by eliminating at the…
-
1
votes0
answers217
viewsReception problems in the GPS module signal
I am trying to develop a program to capture coordinates by the GPS module and send the information to a server concatenated in url form, which will handle the information and display my location…
-
1
votes0
answers46
viewsWhen to use namespace in C++?
Here’s the thing, since I knew how to use using namespace std; was a bad practice I stopped using namespace. Only now I started studying the Opencv library and see in its documentation to use using…
-
1
votes2
answers1220
viewsAspect ratio of an image resized with Opencv?
I have a project where I need to identify objects in an image, currently using the Opencv library in C++. I used the function warpPerspective() Opencv on a 605x141 size image to resize your…
-
1
votes1
answer40
viewsFailure to run loop
// Example program #include <iostream> #include <string> #define ACCOUNT_MAX 3 using namespace std; class User { private: struct Accounts {string user, password, firstName;}; struct…
-
1
votes1
answer694
viewsIdentify memory leak in c++?
Hello, I have recently had problems with the application I am developing. The application seems to lose performance during a certain run time. I checked my code but use only a single object…
-
1
votes0
answers45
viewsGoogle maps API for desktop, and no internet connection
Does anyone know a way to use API from Google Maps to Desktop without internet connection? I need to plot some items on the map, but it is not always that the user will have access to the Internet…
-
1
votes0
answers702
viewsWhat does it mean and what is the purpose of 'Return 0'?
I recently started some studies on C/C++ and in the vast majority of the initial examples I saw, I came across return 0 at the end of the code. #include<iostream> using namespace std; int…
-
1
votes1
answer704
viewsGlobal variable C++
I have that code int main() { ListaVend lista; criarLista(&lista); for(int i = 0; i <= VEND_MAX; i++){ Vendedor vend; vend.codVend = i; vend.nome = "Vendedor "+to_string(i); vend.salFinal =…
-
1
votes1
answer593
viewsRead from a txt file via fscanf using vector
I have the following while(!feof(f)){ (*ptr).push_back(carro()); fscanf (f, "%d", (*ptr)[add].id); fscanf (f, "%s", (*ptr)[add].marca); add++; } Where *ptr is &vector, a vector of a car struct,…
-
1
votes0
answers172
viewsHow to copy network files using C++
I am trying to copy a file from a server to my machine, simply the code runs, does not return me any error, but does not copy the file. Follow the code C++: #include <iostream> #include…
-
1
votes0
answers206
viewsFunction qsort to sort a struct
typedef struct{ long At[tam], Si[tam], Sf[tam]; }TDados; For this struct, wanted to understand how to order the struct by Sf using the function qsort. I wonder if someone could explain to me?…
-
1
votes2
answers82
viewsProcess of connection to libraries (DLL’s) during the C++ source compilation process
During the compilation process, I think, there is some sort of link between my code and the library I’m using code from. How can my application be able to call the code from a DLL? That is, what…
-
1
votes1
answer257
viewsCreating a list with c++ sublists
I’m trying to create a list with sublists (20.0 20.0 0.0) (36.0 150.0 0.0) (200.0 130.0 0.0) (215.0 20.0 0.0) in C++ and I would like some help because I don’t know how to put the 4 together to form…
-
1
votes1
answer260
viewsCode::Blocks doubts
1-How do you put it as a pattern? unintentionally at first when he asks the question I asked not to question more unintentionally and now even reinstalling not appear more. 2-has how to make it in…
-
1
votes1
answer114
viewsHow to put score in a sql Row
Well I am looking for a way to put score on a score of Rows that is made from my mysql. If the returned value is above 1000 it insert scores, for example: 1000 = 1,000 1000000 = 1,000,000 The code…
-
1
votes1
answer445
viewsAssembly and C++ with Visual Studio 2015 and MASM x86/64
Good night. I use Visual Studio 2015 and usually programming in Assembly language via __asm, but I still have doubts about how to use MASM to create code in Assembly for x64. I need help to take the…
-
1
votes1
answer1884
viewsC++ Class Destructor Called in the middle of code
I’m getting deeper into the use of C++, and I’m having trouble migrating an application that uses callbacks and a Singleton to manage settings. During code initialization still in main function, I…
-
1
votes2
answers457
viewsHow to omit certain arguments for which standard values were given in the function prototype parameters?
How to omit specific arguments of the function in C++ for which standard values were given in the function prototype parameters? E.g. how to omit the second argument (b = 4 by default), passing the…
-
1
votes1
answer320
viewsHow to get latitude/longitude of a geo-address using Qt c++ in windows?
It is possible to get the coordinates (latitude and longitude) from a geographical location using only the address, in Qt c ++? I know the Qgeocoordinates, Qgeolocation and Qgeoaddress libraries,…
-
1
votes1
answer81
viewsHow can I pass a Descriptor file to another process?
Recently I read a post by Peter Hutterer explaining about a new protocol called inputfd that is intended to pass a file Descriptor directly to other processes without the interaction of the…
-
1
votes1
answer94
viewsAccessing a pointer pointer ( c )
Why go down a level on the pointer ** lista / * lista we should use parentheses : ( * lista ), I asked the question because I saw in some examples on the internet that they didn’t use and also in an…
-
1
votes2
answers63
viewsProblems with the switch
I am facing problems with this code, when running it the default runs also and in no time I entered with some data other than in the cases. // faz loop até usuário digitar a sequência de teclas de…
-
1
votes0
answers81
viewsRouter authentication
I’m trying to get into my Dlink router using C++ and I’m having problems with the login function! I cannot interact with login and password correctly! Sometimes this error or the code appears .html…
-
1
votes1
answer1204
viewsRand() function does not return random numbers. C++
I have a function that needs to generate, in a specific part, a random number to do a certain task. But whenever the program enters this function, the generated number does not change, always being…
-
1
votes1
answer64
viewsDoubt about iteration with multiple parameters
This loop performs Log_base_2 of an integer value, at the end the result is available in the variable i. Why make a shift in the form valor >> 1 has no effect compared to valor = valor…
-
1
votes0
answers355
viewsC++ to PHP conversion
When converting a code into languages like C++ and other related to PHP we have to convert the direct handling of pointers, in this case, what interpretation should I have about the following code:…
-
1
votes0
answers106
viewsQt project builds on Ubuntu but does not build on Windows
I have a project for college originally produced on the linux platform using Qt Creator and I need to migrate it to windows. I tried to compile but the project has errors in a single header file and…
-
1
votes1
answer319
viewsWhat is the purpose of the C++ qsort function compare function?
See below an example of application of the function qsort, using a function compare: #include <iostream> #include <cstdlib> #include <climits> using namespace std; int compare…
c++asked 7 years, 6 months ago Sergio Souza Novak 513