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
votes2
answers117
viewsTransfer all files from a directory
I have an application that transferred files via socket, but one at a time. I need this application to transfer an entire directory. I must provide a directory, EX: "c: users PASTA_DOWNLOAD Server"…
-
1
votes2
answers5100
viewsHow to search in txt file?
How do I search a file .txt which contains for example a list of numbered names, type: 1 - João 2 - Maria ... I would inform the desired number and the return would be the name, or say that nothing…
-
1
votes0
answers102
viewsScreen Capture, decrease bitmap file size
One of the functions of the project that I am working makes the capture of the user screen, however the bitmap file is getting too big, from 6MB to 8MB, It is bad to be able to send via socket or…
-
1
votes1
answer2287
viewsConsume DLL C on VB6 or C#
I have a DLL (gbasmsb_library.dll) provided by Farmácia Popular responsible for returning some functions for interaction with this environment. I think it is a DLL written in C, I need to consume…
-
1
votes0
answers155
viewsWhat is object-oriented programming?
I know that C++ and Java are examples of object-oriented languages. I know that the Std::Cout << "string"; is an object, but I don’t know what object-oriented programming is. What?
-
1
votes1
answer52
viewsDownloding of WINDOWS directories
I have an application that transfers files via socket, but it is very tiring to have to make transfers from one to one. My question is the following: How can I download a DIRECTORY complete via…
c++asked 9 years, 9 months ago user17270 -
1
votes2
answers520
viewsProblems with if and conditions
I’m making a code that receives three values and orders them from the highest to the lowest. As a condition, when the numbers are repeated, an error message is displayed and the program must close.…
-
1
votes2
answers385
viewsHow to make cmd slower
Is there any command for the cmd run a program I have run from the compiler? I would like to debug what I did and, as I often fall into infinite loop, I want to know if you have how to do the cmd…
-
1
votes1
answer946
viewsDlls error when compiling
Studio: #include <allegro5\allegro.h> int main(void) { ALLEGRO_DISPLAY *display = NULL; if(!al_init()) { return -1; display = al_create_display(800, 600); } if(!display) { return -1; }…
-
1
votes1
answer200
viewsConstructor error parameterized c++
What happens when a class with parameterized constructor is created, with no default constructor, and the object of this type is called without argument in the constructor in c++? Does compile error…
-
1
votes2
answers250
viewsRepeat loop is not running
I am making a code in which there is a vector (with 15 positions) with predetermined values (10 values any and 5 times the value 0), and where the user will inform a new value to go to the end of…
-
1
votes1
answer526
viewsHow to use a C++ API?
I’ve been researching several websites that explain how to use an API, but for some reason I’m doing it wrong. I would like to know how to use the WM_PASTE Windows API to block Mouse Paste(Ctrl+v)…
-
1
votes3
answers4033
viewsUndefined reference compiling with g++
I usually use g++ to compile my code, but now that I’ve started learning template I cannot compile for anything, the following error appears: g++ -c pilha.cpp pilha-infinita.cpp g++ pilha.o…
-
1
votes1
answer90
viewsGet table inside table Lua through C++
I have a moon file with the following contents: Pokes_Icons = { ["Bulbasaur"] = { on = 12906, off = 12908, used = 12907, } } I am trying to get the value of "on" in C++, I tried as follows: enum…
-
1
votes1
answer657
viewsSize of struct allocation
When declaring a normal variable of type int for example, the compiler goes there and, depending on the architecture, separates 4 bytes. struct exemplo{ int x; int b; }; int main(){ struct exemplo…
c++ pointer struct memory-management allocationasked 9 years, 7 months ago Alexsander Borgesdamaceno 541 -
1
votes1
answer268
viewsHow to clear buffer in numeric menu when typing strings?
How to implement a menu that reads numeric values and indicates error (message on screen) when receiving characters and strings? The code below worked well for individual characters through the…
c++asked 9 years, 7 months ago Rafael Bluhm 1,736 -
1
votes1
answer190
views"HEAP CORRUPTION DETECTED"
Can anyone help me out here? Destructor problem. (UP) I think I found the problem, I will comment on the code: If anyone can give me some tips on good practice in this code, please!…
c++asked 9 years, 6 months ago Rafael Moura 13 -
1
votes2
answers1967
viewsProgramming language directly with hardware
I will make applications that need a direct connection to the hardware, for example a mini-Programmable robot that receives information from a sensor and sends to the programming treat and return…
-
1
votes1
answer322
viewsOpengl: what is the basic "package" of shaders to create elements of a 3D scene
At the moment, I am beginning to work with the Shaders concept of the most current versions of Opengl. My basic reference are the tutorials of the open.Gl site. After having seen all the texts, and…
-
1
votes2
answers179
viewsSet position Cursor Windows & Linux with same code
I’m developing a cross-platform application. For this I would like to develop with the minimum of "ifdefs" possible, and what I need to do is basically a fixed screen of 32 x 16 characters. But for…
-
1
votes1
answer82
viewsInstead of maps, how to use a struct vector for the problem in C++?
First I have a struct strcuct Ficha{ int resgistro; float pontuacao; }Fichas[100]; is the following I will read random mode data, but a data always in the list will start with the number that is not…
-
1
votes1
answer74
viewsHow to turn a char array into UTF-8?
For example, I have a char cadeia[300];. I put characters in it, now I want to turn it into UTF-8.
-
1
votes1
answer43
viewsHow to use something similar to Borderlayout in Qt?
I’m doing a project using Qt, and I missed the BorderLayout, Would anyone know if he exists in Qt? If not, there’s one that looks like him?
-
1
votes1
answer451
viewsFile reading.ini
It is possible to read variables in arquivos.ini with C++? Ex: host = "localhost" name = "username" pass = "password" port = 1010 When reading from this file I set through the ifstream. ifstream…
-
1
votes1
answer207
viewsIs it correct to clean an internal malloc to a function with it?
Well given the following code is easy to do memory management: Code Example (in C): #include <stdio.h> #include <stdlib.h> int *criarValor(void){ int *valor = malloc(sizeof *valor);…
-
1
votes1
answer87
viewsProblem with Allegro 4 and C++
I’m trying to create a game in Allegro 4, but I am having problems with a method, more specifically with an attribute BITMAP. The program compiles but stops working right away. Follow the code:…
-
1
votes0
answers1246
viewsError while compiling Allegro
I installed and created the Allegro project following this tutorial. I have that code: #include <stdio.h> #include <stdlib.h> #include <allegro5/allegro.h> #include…
-
1
votes1
answer199
viewsPointer to method
I started studying object orientation and I’m trying to call pointer to method, but I’m having difficulties. The implementation of the method startAllegro class Application is as follows: void…
-
1
votes1
answer2946
views"Uncompiled source file" error
I am using Dev-C++. I compile and when I run the message appears: source file not compiled What am I doing wrong? #include <stdio.h> main() { float lado, area ; cout<< "digite o lado";…
-
1
votes1
answer1018
viewsConvert string char* to Std:string
I have the following code: void splitstr(std::string &modulo, std::string &nmodulo, int &fk) { string frase = modulo; string aux = ""; stringstream strs; for (int i = 0; i <…
-
1
votes1
answer1326
viewsHow to deal with the use of getline() in a for(;)?
I’m storing author names of books in a string array. for(int i = 0; i<qt; i++) { cin >> nome; NOME[i] = nome; } But I want to have the full name, first name and last name, so I thought I’d…
c++asked 9 years ago Filipi Maciel 395 -
1
votes1
answer112
viewsBest way to distribute program using a Shared library
I wrote a program that uses a library called curlpp. The program is very simple and all it does is make an HTTP request that returns a JSON (use the curlpp to perform this request), parse this JSON…
-
1
votes1
answer77
viewsProgram does not execute expected flow
After the "Hello, my name eh Locao......" for me, in logic, I should continue, and if the user wrote 'talk' he would say "Oh, so Voce wants to talk?!". But at that moment it stops, just doesn’t…
-
1
votes1
answer1228
viewsQT Creator - How to open a window with directories for the user to select text file ? C++
I have in a code that makes a list of teachers with their due degrees that is stored with the txt file, making the proper opening with variable ifstream, using open with the name of the file on the…
-
1
votes0
answers176
viewsOpengl code encapsulation in C++ classes
I am currently starting a SDL / Opengl-based project, using the code as a basis of that Article. At the moment, I’m trying to find the best way to encapsulate the example’s Opengl code. My main…
-
1
votes2
answers208
viewsHow do I force entry into "while"?
This program allows to calculate the table from up to 10 to a given number x. But in the cycle of the while after the first iteration it does not enter and jumps to the end. For example, if I insert…
-
1
votes0
answers33
viewsBackpropagation - Cadmium of Deltas
Guys, I’m wondering how to calculate the error for the intermediate layer. I’m using this pdf http://www.dct.ufms.br/~mzanusso/IACC-02/Backprom.pdf. On page 5 he starts to calculate the error of the…
-
1
votes1
answer136
views -
1
votes0
answers124
views -
1
votes3
answers3092
viewsHow to make an integer store a 12-digit number?
I need to find the largest prime factor of the number 600851475143. Because it is a very large number, I cannot store it in a normal integer type variable. The code I made to find the largest prime…
-
1
votes1
answer272
viewsHow to load array items into list box?
I have a TCheckListBox and when it is checked I store the options in an Array. I need that, by clicking on a "List" button, the Array elements (options marked in the TCheckListBox) are listed on…
-
1
votes2
answers194
viewsInstantiate class in a library by method in the Norwegian
I have this line of code, and in it I have 2 methods, where one sets up the keypad and another takes the key pressed. void Maleta::setKeypad(int r1, int r2, int r3, int r4, int c1, int c2, int c3,…
-
1
votes1
answer103
viewsSocket Asynchronous C# receiving more than one message at a time
I am developing a C# Dll that works with Socket TCP Asynchronous for the development of some tools I am working on, the problem appears when the client receives many messages in a short period, in…
-
1
votes3
answers1740
viewsAdd a char to each iteration for c++
How I make for each loop of one to add a char to a word, eg: have the word "char" and inside a go to each loop I want a letter "h" to be added after the "h" of the "char" and in case it would look…
-
1
votes1
answer79
viewsString usage gives error
At the beginning of the code I declare the variable nome as char and when I try to pick up the variable nome down there in the code gives error, I’ve tried several ways and this way this down goes…
-
1
votes1
answer52
viewsEnumerator Random
I’m having trouble making an enumerator tube. enum Notas {A=10, B=22, C=31, D=44, E=56}; There is this solution, but I need the values of the Enumerators and here it is returning the rest of the…
-
1
votes1
answer390
viewsInstalling Qt in Visual Studio
I would like to know how to install QT in visual studio 2015, I did everything, but I can not use it. Whenever I give a #include for example, it says that there is no file or directory. I’ve tried…
-
1
votes2
answers1876
viewsHow to get the serial number or ID of a USB stick on the MS-DOS system?
I have tried using some tools to get hardware information on DOS, but they did not have the source code for free use. I need a code solution that returns the serial number or ID in the MS-DOS…
-
1
votes2
answers579
viewsHow to pass variable normally by value through reference?
I want to pass the variable tabe (who’s kind ifstream) by reference to a function (I don’t want a copy of it, just that the function changes it), well, I don’t quite understand how to do it. Code:…
c++asked 9 years, 1 month ago Roger Amaro Almeida 67 -
1
votes1
answer319
viewsHow to compile c++ with SFML library within the project itself
Hello people who like to program. I have a problem that so far searching on the father of donkeys (Google) I could not solve. I’m doing a little game as part of the evaluation of the programming…