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
answer38
viewsVariable is not found in an operator method
I’m studying operator overload but my code is not compiling. #include <iostream> using namespace std; class Complexo { public: int real, image; Complexo(); Complexo(int r, int i); Complexo…
-
0
votes1
answer43
viewsHow to use a function to check the requirements imposed on a variable in C++?
I want to make a code to train structs. In this case, since the number of cars is 4, I want the choice variable to be limited in the closed range from 1 to 4 "[1,4]". So the logic is: While this…
-
0
votes0
answers89
viewsCount gray and black pixels from a c++ drawing
I have a drawing painted with felt-tip pens and scanned, only seven colors are present: green, blue, black, gray, violet, orange and red I need to know the percentage of color used. I can’t tell the…
-
0
votes1
answer58
viewsQt Error: ASSERT Failure in Qlist<T>
I am new using Qt Creator and am currently working on a project for college and am getting the following error ASSERT Failure in Qlist::Operator[]: "index out of range", file .. /.. /. /..…
-
0
votes2
answers374
viewsErrors in the program to determine triangle
What mistakes I’m making? Read 3 floating point values A, B and C and order them in descending order, so that side A represents the largest of the 3 sides. Then, determine the type of triangle these…
c++asked 5 years, 4 months ago cristovanlopes 5 -
0
votes1
answer76
viewsHow does a car class in Java convert to C++?
public class Carro { private String nome; private int ano; private String modelo; private String marca; private String combustivel; private Double valor; public String getNome() { return nome; }…
-
0
votes1
answer74
viewsCalling recursive function with decreasing operator
I wrote a code for solving a factor-adding problem. When I created the recursive function for the factorial calculation, I used in the function call the decrease operator -- followed by the number,…
-
0
votes0
answers137
viewsWhy does my SD card corrupt in the Afghan rescue?
I have a Kingston 4GB micro SD card and a Datalogger code that deletes the successful file and creates a new one with the new values of the variables. Follow the code below: void back_var() {…
-
0
votes1
answer105
viewsConceptual error about functions in C++!
good morning! I am a programmer beginner in C++, and I am certainly making a conceptual mistake when creating functions, which I could not detect in any forum and material about C++. I have the…
-
0
votes0
answers270
viewsError connecting Mysql to Vscode with c++
I’m trying to connect the Mysql for some time in the Vscode with the linux OS Mint +19, and I’m not making it after taking the following steps: I downloaded Connector on the Mysql website:…
-
0
votes0
answers71
viewsCode::Blocks - Std::bad_alloc
After I run this simple code. #include <iostream> #include <jdbc/cppconn/connection.h> #include <jdbc/cppconn/driver.h> int main() { sql::Connection *con; sql::Driver *driver;…
-
0
votes0
answers352
viewsError request for Member 'quantity' in 'b. Stock::name', which is of non-class type 'char [60]'
Good morning, I’m having this mistake of request for Member in my float, someone could help? struct Estoque { char nome[60]; char quantidade[60]; char preco[60]; }; float caixaAtual = 0.00; float…
-
0
votes1
answer113
viewsProblem with the use of float in vector C/C++
I need to do the following problem in C: Read 12 valid student grades and store them in an array of notes. Assuming that there may be errors in the typing process, some values stored in the vector…
-
0
votes2
answers124
viewsPrintf does not show all variables
I am studying C/C++ in college and came across the following problem, when I run the following code: #include <stdio.h> void main(){ char name[10]; int faltas; double media; printf("Digite seu…
-
0
votes1
answer74
viewsChange class attributes passed as parameter to another class
There are two classes, classa and classb, where it is passed as a parameter to the classb an instance of classa and subsequently an attempt is made to change a parameter of the classa through the…
c++asked 5 years ago Vinícius Lara 3,750 -
0
votes0
answers107
viewsError when compiling program with Curl library in C++
Hello, I’m a beginner in C++. My mission is to successfully include the Curl library, from static form without DLL (code must be included in . exe). After a lot of research, trial and frustration…
-
0
votes1
answer111
views -
0
votes1
answer185
viewsWhen is an operating system created the compilers of ASM, C language, CPP must be created as well or are portable?
1 - AHTAH! Another crazy wanting to re-invent Microsoft - Because this me$#%%$#$ question? To give a little context to my doubt: I have always programmed in high-level languages, to solve…
-
0
votes2
answers194
viewsHow to detect when the user enters something invalid or wants to terminate the program first?
I was doing an exercise in C++ that takes the smallest and the largest number typed by the user, I tried to leave something more automatic, where he goes typing until he doesn’t want more. So I’m…
-
0
votes2
answers96
viewsArray with large numbers
This program stores 5 numbers in array and then displays them, but imagining that I want to save large numbers as: 8.12415367228151 / 119.038571952966 / 169.873349402464 / 324.997128488111 /…
-
0
votes1
answer57
viewsDoubt to return arrays on pointers. below is the code I tried, but only returns addresses
Good night, you guys. following, I would like a help to return a vector, whose goal is to implement a function that takes an integer vector V and returns another integer vector dynamically allocated…
-
0
votes1
answer85
viewsHow to install C++ modules
I would like to know how to install new modules in C++. For example, I recently discovered that there is a module that has an application of the method format of strings very similar to the method…
-
0
votes1
answer60
viewsHow to know the intensity of pixels in a given row or column of a cv::Mat?? [opencv][c++]
I have a project where there is a need to analyze the intensity of the pixels of a certain column or row, that is, my function will be Intensity(cv::Mat m, int ref, Std::string "lico") with a…
-
0
votes0
answers55
viewsC++: calculated float does not enter if
Hi, I need help. I’m not getting into the "if" parole with a floating number obtained after an operation. In the code below when I declare the value 0.05 enters the "if", but when I get the 0.05 by…
-
0
votes1
answer455
viewsProblem turning string into int: "error: no matching Function for call to stoi"
I’m writing a little show input a string of integer numbers as a string and as output an array with twice each of the numbers, also as a string. Despite the function atoi be indicated in that reply,…
-
0
votes0
answers33
viewsDoubt in stdin flow of scanf() function
Greetings to all. I am a beginner in C and I came across the following question regarding data entry; int number1,number2; printf("Digite o numero : "); scanf("%d",&number1); printf("Digite…
-
0
votes1
answer448
viewsObject oriented: "Undefined Reference to" in main.cpp
I’m starting POO (Object Oriented Programming) and am separating my attributes and methods from the class into different files. They are reading each but in main.cpp is giving the error "Undefined…
-
0
votes2
answers526
viewsC++ program for day of the week (with code example)
It is known that the day of the week of a date provided between 1° March 1700 and 28 February 2100 can be determined by the following method: n=int(365.25∗g)+int(30.6∗f)−621049+d…
-
0
votes0
answers38
viewsAntidebug C++ Debug Error Visual Studio
I am adding an Antidebug project to my game, the project itself is already functional, but the part of the code that detects ollydbg for example, is giving me an error after I compile the new…
-
0
votes0
answers51
viewsPython ctypes ERROR: Exception: access Violation writing 0x00DEF6CC
I’m trying to import a dll C/C++ with the lib ctypes and use a function that it has internally, when passing the parameters to this function I always come across the error: ERROR: exception: access…
-
0
votes1
answer51
viewsHow to sort an array using two attributes?
Come on... I have a class Student, which contains the attributes name, idCurst and situation. I also have a vector that stores several objects of the Student type. I also have a method ordain() that…
-
0
votes3
answers95
viewsIf counter in a text file
Guys I’m trying to make a program that counts the number of ifs in any text, but for some reason it doesn’t count all, if you can help me thank you #include <stdio.h> #include <stdlib.h>…
-
0
votes1
answer191
viewsArduino + SIM800L Connect to Firebase
Galley, I’m putting together a project and I need to connect my companion to firebase. For this I am using a SIM800L, however my code return the error below in the compiler, someone has already gone…
-
0
votes1
answer58
viewsHow to sort an array using three attributes?
Come on... I have a class Student, which contains the attributes name, idCurst and situation. I also have a vector that stores several objects of the Student type. I also have a method sort() that…
-
0
votes1
answer45
viewsHow to insert data into a member vector of a struct?
I’m trying to build a structure composed of members that are no more than strings. The 4th member is a string array, since it needs to store more than one piece of information. Once done I declare I…
-
0
votes1
answer46
viewsFunction parameter eeprom_write_block
Hello! I was performing some tests using the library avr/eeprom.h in my Arduino. One of its functions is to eeprom_write_block(x, y, z), writing a memory block on the EEPROM. The first parameter (x)…
-
0
votes1
answer69
viewsI’m having trouble separating an integer from a variable
Good morning Guys, I’m having trouble on the following issue. Write a program that receives a time provided by the user as a single integer (hhmmss) and write time in the form: hh:mm:ss. The program…
-
0
votes1
answer34
viewsIs it possible to pointer pointer access class member?
I’m starting a Gtkmm app with Glade. I want to put all event handling functions in a separate class from which the Glade file is being instantiated. Following the example of the book Programming…
-
0
votes0
answers32
viewsAllocate the user to set the vector size
Hi, I’m solving an ex. basic of c++ where it asks to do a function that takes as parameter a vector of n° real and that reads from the keyboard n n° real, store them in the vector and calculate its…
-
0
votes0
answers38
viewsCompare map<string,any> c++ 17
I can’t compare two maps . Ex: map<string, any> columnsMap = { {"status", 1}, {"client_delivered", 0}, {"client_notification", 0}}; map<string, any> columnsMap2 = { {"status", 1},…
-
0
votes0
answers318
viewsFill a vector of size[10] with two other vectors[5] at positions 0, 2, 4, 6, 8 and 1, 3, 5, 7, 9
Question: Create two vectors with size 5 and a size 10 vector; Fill the two size 5 vectors with integers inserted keyboard; After filling the two vectors of 5 positions their content should be…
-
0
votes1
answer44
viewsHow to use Bezier curves to describe 3d animation in c++ efficiently?
I’m developing a 3d program in c/c++, I’ve done the rendering part of the objects, I’m missing the animation part, basically I want to use a list of values (frames) each containing the frame time,…
-
0
votes1
answer216
viewsError: stack Smashing Detected
I’m having the mistake: * stack Smashing Detected *: terminated in my program Use the compiler g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, here is the code: #include <iostream> using…
-
0
votes2
answers498
viewsHow to delete the terminal from what was written when running a C program?
People I am with a tremendous doubt. When I run a program in C it shows the information that are in the terminal. But then I want to delete what was written to show a new information. I have done…
-
0
votes1
answer205
viewsSolved - Error running the program, please help. terminate called after'Std::bad_alloc'
Hi, I have a question. I’m making a program, a social network, I set up a start screen function, in which the application returns to it after a task is selected. For example, register profile. the…
c++asked 4 years, 6 months ago David Ribeiro 1 -
0
votes1
answer1798
viewsERROR C++ - [Error] ISO C++ forbids comparison between Pointer and integer [-fpermissive]
I’m learning C++ and copied a code from the internet and gave it a modified one, but it presents the Error when compiling - [Error] ISO C++ forbids comparison between Pointer and integer…
c++asked 4 years, 6 months ago edvaldo jose 3 -
0
votes1
answer107
viewsC++ - Std::Hex is not returning hexadecimal value
I am trying to develop a Gameboy emulator as a challenge to myself, I am in the process of decoding the opcodes, for this I need to get the hexadecimal value of it extracted from the game ROM, but…
c++asked 4 years, 6 months ago Samuel Ives 1,676 -
0
votes1
answer129
viewsChange button color when click = Gree when drop back normal color?
I want when I click on Button it to change color and when I drop it back to original color! Part of Button public void addButton(String comprar, final InterfaceBtn interfaceBtn) { final Button…
-
0
votes1
answer315
viewsHow to make a menu repeat itself until a variable option?
I am making a program in C++ that must generate three numbers and organize them according to the user’s choice, two options are provided and he must choose one, but I don’t know how to make the menu…
-
0
votes1
answer55
viewsLoop for resetting the control variable in c++ Qt Creator
Good night. I’m making a program that converts numerical bases into Qt Creator using C++, and the function that converts from any base to decimal, has a loop for: int toDeci(QString str, int base) {…