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
-
2
votes0
answers68
viewsWhat is the ideal way to close a C++ thread
I’m trying to close a thread, but it appears the message "Process terminating with default action of Signal 6 (SIGABRT)", with memory error including Leak. How hard I try to execute: valgrind…
-
2
votes0
answers27
viewsConnection terminates when sending a message from the client to the server (c/c++ socket)
I am using the codes below to make a client-server connection. The client I am making myself and the server for the time being picked up on the internet. The connection between them is made and the…
-
2
votes0
answers39
viewsClock time in integer value instead of float
I am creating a micro engine, for study purposes, and wanted to simulate a movement vector of a body/object through time. I started doing an infinite loop to do the object vector updates over time,…
c++asked 3 years, 9 months ago Gustavo Campos 46 -
2
votes1
answer62
viewsHow do I create a loop that allows you to cancel the previous order when it passes a certain value?
Good evening. The following language is MQL5. I am creating a robot for Metatrader 5. I created after many hours the following code. I made the comments in English just like in the tutorial because…
-
2
votes1
answer63
viewsHow can we not access it with pointers?
I have a code where I create and then read a file .dat with information from sales records, such as date, time, price, etc. I can do a search by date, for example, and generate another file .dat…
-
2
votes1
answer62
views"local" server with python, does not receive an external POST on the same network
I have a server running on Windows 7 PC and am using Pycharm IDE to edit and simulate. This server is receiving information from an ESP32 module that is connected on the same PC network. Sending the…
-
2
votes1
answer68
views"strlen()" works with literal but not string type variable
I have this code: #include <iostream> #include <string.h> using namespace std; int main() { int len = strlen("Teste"); cout << len << endl; return 0; } That generates the…
-
2
votes0
answers47
viewsHow do I transfer responsibility from a pointer?
During the implementation of the Pattern Command design, I came across the following dilemma: "As I signal to customers of a particular class, the pointer passed as parameter will be destroyed?". To…
c++asked 3 years, 5 months ago Durval Carvalho 405 -
2
votes2
answers71
viewsHow to use comparison function on a Std::Sort
In the code below the program must order the vector campanha based on the number of votes of each councilor: #include <iostream> #include <vector> using namespace std; struct Vereador {…
-
2
votes1
answer70
viewsDoubt about C++ pointers
Why if a char type raw pointer is pointing to some character of a std::string and print this pointer without the asterisk (*) it will show the rest of the string from the character it is pointing…
-
2
votes1
answer15
viewsProblem compiling Math. h
Good evening, when I try to use some function of Math. h and put as argument a variable and try to compile I get an error. Can you explain to me why this is happening? Follow an example code:…
-
1
votes3
answers942
viewsUndefined Reference when compiling multiple files
I’m learning C++, and I have a question about creating classes in different files. I created the header with prototypes of functions, then as member functions in another cpp file. When I go to test…
-
1
votes1
answer69
viewsUpdate a Tableview
How can I update a Tableview after closing a Dialog? Example: principal.ccp abre conexão com banco de dados principal::principal(){ //..etc..// model->setTable("nomeTabela");…
-
1
votes1
answer105
viewsInteger to price conversion using Qlocate
How can I use QLocate to convert integer into standard Brazilian price form (without rounding up the figures)? Code: QString n1 = "1.020,50"; QString n2 = "10,33"; int valor1 =…
-
1
votes2
answers287
views -
1
votes1
answer47
viewslocaldb usage with team Foundation server
I have a visual studio solution, which contains several C++ projects and an SQL DB project, which is published in a localdb instance. Version control is done using Team Foundation Server. My…
-
1
votes1
answer1343
viewsHow to make a vertical bar graph with the c+# character?
Performing a C++ job here at the college: How to carry out a vertical graph in bars, that is, from the bottom to the top, of some vector. Suppose there is a vector with some positions, for example…
-
1
votes1
answer88
viewsString parse separated by null values
I am using the OpenFileName winapi with multiselect flag. When the user selects several files he returns me a string separated by nulls according to the following model: "[caminho da…
-
1
votes1
answer131
viewsProblem with Saving txt File to C++
Every time I try to record something new in this file, it erases what was saved before, it keeps saving on top of what it had before, someone can tell me what it is? arquivo =…
-
1
votes1
answer2462
viewsCall a specific function as you choose from the menu
I need to make a program that simulates a bank ATM in C++, presenting a menu that has Deposit, Withdrawal and Payment of Tickets. How am I going to do that? I’ve done the following: #include…
-
1
votes1
answer96
viewsAuto benchmarking with moon
A script in C or C++ could write algorithms in Lua (by Brut force, that is, test several possible combinations) based on a database with the results of the algorithms. The idea is to get to the most…
-
1
votes1
answer148
viewsList data from two tables in the tableView
What do I do to list two table data on tableView? Sqlite Database(Example): tb_venda tb_produto tb_valor tb_cliente_id (Id do cliente "tb_cliente") tb_cliente tb_cliente_id (id primary key) tb_nome…
-
1
votes1
answer280
viewsC++ if select object
I am making a program for Rduino written in C++ to turn on and off leds when a button is pressed. I created an Led class and put in it the methods, now I wrote an if that checks when a button is…
-
1
votes1
answer73
viewsIs it possible to create an Std::list with an initializer_list?
I’d like to pass one std::list temporary to a function, but do not know if it is possible to do it. I know it is possible to pass a std::vector temporary with a initializer_list: #include…
-
1
votes2
answers84
viewsError accessing pointer
int main() { int**items[5]; for (int i=0;i<5;i++) { *items[i] = new int; <-- } return 0; } The program compiles, but does not run. I Debugger and pointed out that the error is where the arrow…
-
1
votes1
answer160
viewsCopy Qvector Local to Qvector Class
Here’s what I’m doing in the nail a Linechart chart chart for a class assignment, I’m having huge difficulties with the C++ language, in some part of the code step by parameter a…
-
1
votes1
answer113
viewsGOTO and ACTION table generator
Regarding LR Parser, I fear the following Wiki: http://pt.wikipedia.org/wiki/Analisador_sint%C3%A1tico_lr#Algorithm There is a canonical algorithm to generate the GOTO and ACTION tables. I searched,…
-
1
votes1
answer470
viewsPair de vector c++
I implemented the traveling salesman and show the minimum cost of all paths. Now I want to show the path that corresponds to the lowest cost. I’m using to do this one pair<int, vector<int>…
-
1
votes1
answer1103
viewsI can’t find my mistakes
Someone can help me, this program is making several mistakes, but I can not find any. I thank you already. Mistakes: [Error] cannot Convert 'int*' to 'int**' for argument '3' to 'int reading(int,…
c++asked 10 years, 5 months ago Henrique Melo 73 -
1
votes1
answer248
viewsChar problem * and fgets()
I have a struct with a vector type field of char and I have a file .txt with several lines in this format with song names. text 1 text2 text 3 text4 I need to read the entire file row by row and…
-
1
votes1
answer2270
viewsPrint position of a matrix
The intention in this program would be to print the position linha and coluna where the highest value is located within the matrix, someone can tell me why the result is printing 0x0 and if there is…
c++asked 10 years, 5 months ago Adrian Roger 129 -
1
votes1
answer111
viewsHow to use a constructor with two or more classes?
I am developing an object-oriented library. I created an iterator for my future container. I have advance_iterator and regress_iterator. Both give rise to bidirectional_iterator. The code is:…
-
1
votes3
answers1404
viewsInfinite loop when typing a character
I’m doing error tests on my "Monkey Test" program and it goes into loop infinite when I type a character on the keyboard other than number. int ActionGenerator() { bool Verify; int Action; Verify =…
-
1
votes1
answer361
viewsfunction in Graphics. h
I’m trying to learn a little more from C/C++ libraries to do more things so I went after the Graphics library. and went after the most basic code I found, which was: #include <graphics.h> int…
-
1
votes1
answer1943
viewsAssertion error Failure: "(!"Setthreadcontext failed")" in .. win32src thread32.cpp at line 434
I am compiling my C++ project in Codegear 2009 from Embarcadero, and when I start debugging my program this message appears: bds.exe - bordbk120N.dll Assertion Failure: "(!"Setthreadcontext…
-
1
votes2
answers303
viewsHexadecimal numbers in reverse
How to print the hexadecimal numbers typed by the user backwards? For example: Entrada: 0x101c4701 Saída: 01471C10 If possible in Java and C++. In reality I want to get the information contained…
-
1
votes1
answer375
viewsHelp: Valuing a char vector of a struct within an if
I’m trying to define the value of a char vector of a struct within an if, but without success... The struct itself: struct ficha { char nome[31], classificacao[31], telefone[21]; float altura, peso,…
-
1
votes1
answer137
viewsHow to simulate a browser?
More specifically, I’ll be streaming music with Mp3skull, which has no API. So far, what I’ve been able to do is use an HTML Parser and go div by div looking for the common id of all the songs.…
-
1
votes1
answer1547
viewsError C++: E2034 Cannot Convert 'wchar_t *' to 'const char *'
When executing a C++ code these two problems occur: - [BCC32 Error] USerialCommunication.cpp(96): E2034 Cannot convert 'wchar_t *' to 'const char *' - [BCC32 Error] USerialCommunication.cpp(96):…
-
1
votes1
answer627
viewsBest IDE Designer GUI
I am currently using Visual Studio 2012, and to create window applications, I need to use C++/CLI, but I saw that it is outdated (wikipedia). What would be another alternative? Wxwidgets is…
c++asked 9 years, 11 months ago Gabriel Sales 1,257 -
1
votes1
answer1611
viewsHow to organize a C++ project into folder structure in Visual Studio
I would like to separate my source code into folders to have a better organization in the code by grouping the files into directories. In general, you usually have a lot of files . h and . cpp and I…
-
1
votes0
answers861
viewsHow to render graphics in Qt applications?
I’m developing a small application to read a serial port. I would like to know how to generate a graph that is updated in real time with two variables, one x (time), and another y…
-
1
votes1
answer62
viewsMemory Leak in Video Player
I’m implementing an application in C++/cli and Winforms that features videos continuously. During execution, when videos are loaded the memory increases and is released later. I’ve noticed that…
-
1
votes1
answer79
viewsPassing address to Writeprocessmemory
I’m trying to pass a memory address to WriteProcessMemory(), only that this address should be typed by the user, I am in doubt of how I can do this, I tried with strings, wstring, did not succeed.…
-
1
votes1
answer450
viewsCall Java class (.JAR) using C++ (.EXE)?
I have a Java application (SYSTEM.JAR) with the system input class ... Ok? To make it more transparent to the end user, I would like to create a compiled . EXE in C++ that just calls the Java class.…
-
1
votes2
answers4088
viewsHow to concatenate two chained lists?
I created this code by initializing a list, but I need to improve it, creating a function that concatenates two and at the end prints the value of the two concatenates... Yeah, I don’t know how.…
c++asked 10 years ago Paulo Roberto 1,988 -
1
votes1
answer203
viewsWhat should be returned in the Wndproc function in C++?
Hello. See the code below: LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { if (message == WM_CREATE) { return(?); } else if (message == WM_COMMAND) { return(?); }…
-
1
votes1
answer542
viewsStop accepting data to queue dynamically
I need to stop queuing when the user enters a negative number (-1), check if the queue is empty so that when typing the negative number does not give any error and the main one, I need the user to…
-
1
votes2
answers634
views -
1
votes1
answer103
viewsConvert reverse_iterator to iterator?
I am writing an XML interpreter in C++, when I find a bad formation in XML I would like to show the error row and column. I am working with string Iterators and created a function to format the…