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
-
0
votes1
answer602
viewsHow to convert RGBA pixels to characters?
having access to the pixels of any image through the SFML library, my goal is captured and convert them to characters by placing in a new matrix (image) and then display it. For that I checked the…
-
0
votes1
answer368
viewsSave bi-dimensional array to EEPROM memory
I’m making a program for the Arduino written in C++ to turn on and off leds when a button is pressed. I want to save in an EEPROM memory the values of the leds that are connected and the amount of…
-
0
votes1
answer121
viewsHow do the istreams of a string work?
To catch a std::string, type pointers are required char, as far as I know. However, to grab a pointer, you have to allocate memory (necessarily, or there will be a runtime error, one Segmentation…
-
0
votes1
answer130
viewsConverting split expression to C++ to C#
I have the following condition in C++ and would like to move to C#. The problem I’m having is with the function div error: The name 'div' does not exist in the Current context if (quant > 0) {…
-
0
votes1
answer122
viewsError passing an object array in C++
I have the following function: int verticeEstimativaMinima(Node *grafo, int numVertices){} And in my job main, I have the following line of code: Node *grafo = new Node[numVertices]; I mean,…
-
0
votes1
answer140
viewsVector error(one-dimensional matrix)
Can anyone tell me what’s wrong with this algorithm? Make a program where the user enters with N values and stores the first 10 even numbers in a vector called even. When you reach the tenth even…
c++asked 10 years, 5 months ago Adrian Roger 129 -
0
votes1
answer977
viewsC++ function Error: cannot be used as a Function
square cannot be used as a Function. Can anyone tell me how to fix? #include <iostream> #include <string.h> #include <sstream> #include <cmath> using namespace std; struct…
c++asked 10 years, 5 months ago Henrique Melo 73 -
0
votes1
answer640
viewsPass pointer as C++ function parameter
Good morning guys, I have the following problem: I have a class that represents a List, and from it I created three objects (I don’t know which one to give) list1(5), Lista2(5), list3(10).…
-
0
votes1
answer155
viewsShowing the value of Readprocessmemory C++
once I used the function below: BOOL readyProcessMe = ReadProcessMemory(process, (LPCVOID)memory, &value, 4, 0); How can I show the correct value on a label?…
-
0
votes1
answer383
viewsAdd pointer to an Std:vector
Hi, need to add in a vector<TimedCommand> tCommands; access references for Timedcommand instances, example: TimedCommand command1("*.*.*.*.*.*",&sonCommand,"13"); (...)…
-
0
votes1
answer577
viewsCritical section problems in concurrent programming
I am implementing in C++ a system with threads using semaphores. I am with a doubt, if I treat the progress situation, I will guarantee 100% that my implementation will not occur no impasse? Or I…
-
0
votes1
answer3045
viewsHow to develop a basic game using opengl that accepts keyboard commands
I tried to follow the source of a tutorial Metar Gearn Nanna, because I was interested in creating a game in opengl and c++, it could be something simple, with precarious validations, just to…
-
0
votes2
answers424
viewsQT signal from C++ to QML
I am trying with QT 5 + QML to create an application where after opening the file using the fileDialog it returns a message by a QT signal. The application opens using a QML and initiating a call to…
-
0
votes2
answers249
viewsProblems with vectors and structs
I’m kind of new to C++ (because the code is basic) and I’m having a certain problem with an exercise that is necessary to store the data of 10 people (name, date of birth and height) using structs.…
-
0
votes1
answer2993
viewsConvert C++ to C#
Well, I’m passing some codes I have, and I’m doubtful I can pass that code to c, and I’d like help from anyone who can help, in the following code below #include <dirent.h> #include…
-
0
votes1
answer73
viewsLoss of reference per parameter
I have the following problem, when executing the method insereOP() the instances maq and cli lose their data. So when I call the method atualizarOP, client and machine information do not exist,…
-
0
votes1
answer1364
viewsHow to use the Curl library for c++ correctly?
I’m having trouble copying a simple test using the Curl library to C++ because it always returns this error: C:\Users\Raphael\Desktop\HTTP Request\collect2.exe [Error] ld returned 1 exit status…
-
0
votes1
answer1060
viewsC/C++ - Error comparing char with strcmp()
I need help, I’m having problems comparing two variables using strcmp(). [Error] invalid Conversion from 'char' to 'const char*' [-fpermissive] struct transicao{ int estado; //estado em que o DFA…
-
0
votes2
answers4889
viewsI want to save the information to a . txt in c++
The problem here is that it creates the file 'test.txt' however when it comes to recording the file it does nothing... I’ve seen the file permission and this ok... I didn’t understand anyone could…
c++asked 10 years, 2 months ago Geovani Luiz 113 -
0
votes1
answer193
viewsFind correct positions in the Matrix
I’m having difficulties with this reasoning. I have a matrix 4x4. I must fill it with 0 and 1, provided that the number 1 appears twice in each row and in each column, as in the example below. 1 1 0…
-
0
votes2
answers112
viewsReactivate form to closure of other
I have a form main and from this form I click on a button and open another form, So when I open this other form I disable the main one, so that’s okay, so I wanted when the user closes the second…
-
0
votes0
answers36
viewsHow to use Qhull
You know the Qhull? He makes a triangulation Delaunay. I have a set of points in a file and I want to generate the vertices, but I’m not able to put the commands in the program.…
-
0
votes1
answer530
viewsSend and Receive data via Socket
I am beginner in socket, I would like to know what is the best way to send and receive data. I would like a better explanation about how it works.
-
0
votes1
answer146
viewsWinsock remote data reading (CMD)
I have a server (remote) where redirects your shell to the client (remote), the client side is using netcat or telnet for communication. I am developing the client side for use with Windows, but I…
-
0
votes0
answers110
viewsUsing elements of a Form within a function
I am developing an application in C++ Builder that has a Form which contains elements such as ListBox, buttons, Labels, etc.. I can configure the events of each of these elements (onClick, onEnter,…
c++asked 9 years, 10 months ago Thiago Cavali 53 -
0
votes3
answers182
viewsIs there any way to put Input automatically?
Recently in a programming contest I came across the problem of having to put more than 250 inputs in one problem. I wonder if there is any way to put the Inputs other than 1 by 1, at hand!
-
0
votes1
answer121
viewsConversion of STRING, Writeprocessmemory()
I have the following situation, the user must enter a memory address: (I’m using this method, may not be correct for the following situation) std::string TEMP_MEMORY_ADDRESS; std::string…
-
0
votes1
answer55
viewsStoring information about students
I need to develop a program platform WINDOWS where it will be stored information about students of the kind: age, gang, shift and name. The program must also contain a search for name. I would like…
-
0
votes1
answer122
viewsProblem with Struct
I have the following error in my code: error: request for Member 'media' in 'given', wich is of non-class type 'Dadosaluno [5]' Code: #include <iostream> using namespace std; struct…
-
0
votes1
answer273
views -
0
votes1
answer675
viewsHow to Collide 2D from C++ Tiles
Hello. I wonder how I can get collision of Tiles in C++. I am using an engine made by my friend, even so, I would like to know how to do. I’m using SDL 2! Grateful from now on Thiago…
-
0
votes1
answer205
viewsHow to get the value of a memory variable?
I course the first period of CC and would like to know how I could achieve variable value of a game, for example, in real time. For example, when a boolean variable changes the value to TRUE, I…
-
0
votes2
answers1725
viewsPrint the largest N notes and names among the values that are in the struct array
Hello, I would like some help here, more specifically in case 4 if. I would like some solution without having to order the vector. Grateful. #include <iostream> #include <cstdlib>…
-
0
votes0
answers473
viewsMakefile.win error while compiling project
The archive Makefile.win makes a mistake when trying to compile my project. A warning appears asking to reload the file, after pressing YES and trying to re-compile it appears again the same warning…
-
0
votes1
answer693
viewsLoad JPG image and show in window
How should I proceed to load an image in jpg format from a directory and then show in the following window? int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int…
-
0
votes1
answer90
viewsProblem with file recognition. h
Well I created a arquivo.h and a arquivo.cpp, of arquivo.cpp by including the #include "arquivo.h" automatically recognizes, already in my main.cpp does not recognize there I cannot use the data of…
-
0
votes1
answer78
viewsBuild error with structs
The following error is happening in the compilation of the code below: ..\src struct.cpp:19:19: error: Elements of array 'main():ficaha v [3]' have incomplete type .. src struct.cpp:19:19: error:…
-
0
votes1
answer601
viewsHow do I define the push_back function for a c++ structure?
How do I use the function push_back in a structure? I have the arch structure: struct Arco { int i, j; Arco () {}; Arco (const Arco& obj): i(obj.i), j(obj.j) {}; Arco(int _i, int _j) : i(_i),…
-
0
votes1
answer70
viewsEditing in Linked Lists
I have a college protégé for a programming chair. One of the objectives is the evaluation of inserted projects (the insertion part I already have working), my problem is that when evaluated, I don’t…
-
0
votes1
answer128
viewsHow to take the number separated by the whole function just below and sort it correctly as described in the main doubt in bold in the question in C++
The function to separate an integer number from a noninteger is simple void Inteiro(float n) { int x = n; float y = n; if (x==y) { cout << "E inteiro" << endl; } else { cout <<…
-
0
votes1
answer45
viewsPossible to implement Keyevent in a class that inherits from Qwidget instead of Qframe
My class: class Jogador : public QWidget { Q_OBJECT public: Jogador(QWidget* parent = NULL); void draw(); void paintEvent(QPaintEvent* event); void keyPressEvent(QKeyEvent* event); private: int…
-
0
votes1
answer59
viewsWhy can’t I capture Keyevent in this program ? Problems are in the main?
#include<QApplication> #include<tabuleiro.h> #include<jogador.h> #include<QWidget> int main(int argc, char* argv[]){ QApplication app(argc, argv); QWidget window; Tabuleiro…
-
0
votes1
answer267
viewsUsing double type in c++ can be "faster" in terms of running time than using floats?
I have a program developed in c++ in visual studio, which processes a huge amount of data! This program can use both float and double type data, and this specification is made as follows: typedef…
-
0
votes0
answers58
viewsHow to use boost::Function with variable parameter number function?
In a library I use, a function Z expects a pointer to function with the following signature: typedef void (*func)(double, ...). I want to write a class in such a way that I can pass an object from…
-
0
votes0
answers130
viewsError while compiling in DEV-C++(SDL)
I did all the procedure to use SDL2, but when I compile the following error happens [Error]SDL/SDL.h: No such file or directory This is the content of the line where the error occurs…
-
0
votes0
answers124
viewsHow to read a DLL with Cordova or Javascript
I’m creating a app that to communicate with my server I need to create a hash variable that depends on the class, function and parameters I am sending. the server validates this information and only…
-
0
votes1
answer28
viewsCall to 'Ansireplacestr' is ambiguous
After switching RAD Studio XE8 to RAD Studio 10 Seattle I got the following error: [bcc64 Error] Unit1.cpp(425): call to 'AnsiReplaceStr' is ambiguous System.StrUtils.hpp(51): candidate function…
-
0
votes1
answer658
viewsIs it possible to pass string from string class as pointer to function?
it is possible to pass string from string class as pointer to function? example: void separaStr(string *modulo, satring *nmodulo, *digito){}
-
0
votes1
answer744
viewsVector class and random numbers in C++
The function only returns me the memory address, how do I make it return the content and not the memory address? #include <iostream> #include <time.h> /// por causa de srand() #include…
-
0
votes1
answer2020
viewsProgram requesting libgcc_s_dw2-1.dll
This mistake is happening: I’m using Code::Blocks, trying to create a program with wxWidgets.…