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
votes1
answer66
viewsFunction does not add to list
THIS IS THE SOURCE: #include <iostream> #include "gestor.h" using namespace std; int menu() { int opc; cout << "Faca a sua escolha!" << endl; cout << "1-> inserir avaria!"…
c++asked 9 years, 1 month ago kingwarrior05 617 -
1
votes1
answer88
viewsExit loop as soon as the string name equals 0
#include <iostream> #include <locale.h> #include <stdlib.h> #include <stdio.h> #include <string.h> using namespace std; int…
-
1
votes1
answer228
viewsPass struct matrix as argument
Having the struct struct bloco { bloco () : real(), marcado('.'){} char real; char marcado; }; When I try void tabuleiro (int lado, int mina){ ... bloco tab[lado][lado]; ... for (i=0, j=0;…
c++asked 9 years ago Davi Grimaldi 13 -
1
votes1
answer189
viewsSegmentation failure
I created a class to display a string at the terminal, but in addition to displaying the string, also, displays the following message: "segmentation failure". I debug with GDB, but could not resolve…
-
1
votes3
answers131
viewsBucket Sort + Thread
I’m having the following error in this code: #define TAM 10000 /*Tamanho do vetor*/ #define NUM 10000 /*base para gerador de numeros aleatorios*/ using std::cout; using std::cin; using std::endl;…
-
1
votes1
answer87
viewsQt Qdebug does not work (does not display messages)
I own the Fedora 23 operating system and use Qt to develop graphical interfaces (GUI), however my Debugger does not work: I’m trying to print messages on console using qDebug(), but nothing is…
-
1
votes1
answer860
viewsHow to solve the problem of accentuation in the terminal?
I’m writing some strings on screen using the Opengl library and some of the words saved are accentuated words, example: república checa, where the exit ends up being: repblica checa has how to solve…
-
1
votes2
answers282
viewsHow do I use the Chr() function in C++ Builder?
I need an example of using the function Chr() or something equivalent in C++ Builder. I’m needing to do a function to decrypt the database password.
-
1
votes2
answers276
views -
1
votes1
answer56
viewsAccess Violation in module 'Dbxcommondriver220.dpl'
I’m having trouble using Firebird in Embarcadero C++ XE8. Error: Access violation in module 'DBXCommondriver220.dpl'
-
1
votes1
answer492
viewsUndefined Reference error when trying to use a template class
I have a class template Set and a menu class both with their respective . cpp and . hpp, when trying to use a cluster class pointer in my Menu class I get the following error: ||=== Build: Debug in…
-
1
votes1
answer68
views"no overloaded Function takes 0 Arguments" when trying to insert into Std:
bunny is the standard class that has only the bunny(construtor) and ~bunny(desconstrutor) pattern. int main() { vector<bunny> bunnies; // Este usa o construtor padrão. bunnies.push_back(); //…
-
1
votes1
answer684
viewsIs it recommended to use IDE for C++ programming?
When I was learning C I was programming using a text editor and a compiler, but since C++ is POO-facing maybe an IDE will help although I haven’t been much in favor of IDE’s. I would like to…
-
1
votes2
answers2433
viewsHow to make a local variable global in C (or C++)?
I can turn a local variable into a global variable, even though it’s within a function? In C or even C++ if it doesn’t exist in C. I’ve seen something like this in Java, but I don’t know exactly how…
-
1
votes2
answers61
viewsWhy "Segmentation fault " when two arrays are interspersed?
I’m building a simple c/c++ program that intersperses two arrays but I am encountering an inconvenient error. I believe when calling the function IntercalarArranjos, the program shows an error of…
-
1
votes1
answer418
viewsFunction int(*Cmp)(void*,void*)
I know it compares pointers and returns an integer that determines whether one is smaller than another, in order. But, when I will use it in main(), is giving some error. Can help me?…
-
1
votes0
answers53
viewsHow to make Visual Studio not let use functions without including headers
In C++, the printf() and scanf() command needs the cstdio library to work, but in Visual Studio I can run without including them. As I send my programs to a site that doesn’t allow this, I wanted…
-
1
votes0
answers112
viewsHelps port part of the Java code to C++
I am in a project and my 'responsibility' is to port the Java code to C++ that uses Opengl. I’ve done almost everything, but it doesn’t work. I think the problem is in this class that I could not…
-
1
votes2
answers1024
viewsHow to find the size of a character array?
#include <iostream> #include <string> #include <locale.h> #include <stdio.h> using std::cout; using std::cin; using std::endl; using std::string; int main(){…
-
1
votes1
answer133
viewsIs there any way to access a position by string?
There would be no way to access a position using a string? Example: int vetor[1000000]; vetor["abc"]++; I know it’s crazy of me, but... "abc" = 01100001, 01100010, 01100011, 00000000 (null…
-
1
votes1
answer339
viewsWhy is the complexity cost of a BFS O(n+m)?
I need to show that the cost to know if there is a path between two vertices v and w is O(n²). For this I can make a BFS in a graph, only, the cost of a bfs is O(n+m), but I do not understand why it…
c++asked 8 years, 3 months ago Filipi Maciel 395 -
1
votes1
answer79
viewsQueue of tasks or my own solution for Thundering Herd?
I am developing a network server application in C++ and came across the problem Thundering Herd, once I designed to have multiple accepting threads (accept()) customers' connections simultaneously.…
-
1
votes1
answer49
viewsVisual Studio 2015 shows no Qstring content during debug/debugging
I’m using Visual Studio 2015 to develop an application in Qt 5. Everything works correctly, but when I try to debug the code and inspect a variable of type QString, debug does not show the contents…
-
1
votes1
answer3898
viewsC file manipulation (skip lines)
Hello, I’m having a problem to skip lines in a file, I use fgets(), but it always prints the first line of my file. I also did some tests, and for some reason, there is only one iteration and x…
-
1
votes1
answer337
viewsHow to create an abstract class in C++?
In C++ virtual uses file . cpp #ifndef TETES_H #define TETES_H class Tetes { public: Tetes(); virtual ~Tetes(); virtual void exibeDados(); protected: private: }; #endif // TETES_H file . h #include…
-
1
votes1
answer123
viewsPrivate variable error in C++
I can’t understand why I’m making this mistake when compiling my code: In file included from test_GenericArray.cpp:2:0: Genericarray. h: In Function ːStd::ostream&…
-
1
votes1
answer69
viewsHow to pass the class (Teste2 teste2) as reference in the ("super") C++ constructor?
On the basis of that reply In C++ what command corresponds to super() of Java? Class Teste2{ int x; int y; public: Teste2(int x, int y){ . . . } } class Testando{ Teste2 *teste2; public:…
-
1
votes1
answer79
viewsLNK2001 error in C++ Project Build
I’m trying to build a project in Visual Studio and this error is appearing: Severity Code Description Project File Line Suppression State Error LNK2001 unresolved external symbol "class CPSock…
-
1
votes2
answers2002
viewspass objects as parameters in c++
hello, I would like to know how to pass an object created in c++ as parameter of a function of another object,vi in the forum in English,but I did not understand very well how it does,if someone can…
-
1
votes0
answers802
viewsHow to grab a JSON file and decode into C++ ? read the Json file in C++
I have a file JSON with employee data and wish to read this file in C++ to pass para a flash drive and export this file, how to proceed? Follows file JSON: ":"Alexandre N. da…
-
1
votes1
answer134
viewsArduino: Bluetooth connection, and data storage
I am a beginner and I have some projects in mind, I wonder if it is possible to connect the phone to Rduino and make q an application pass some data to some memory linked to Uino and dps other…
-
1
votes1
answer2122
viewsHow to create a driver to make my own usb mouse with PIC?
Hello, I’m trying to develop a mouse using a pic and instead of using an optical sensor usually used in mice I wanted to control using accelerometers. How do I create a Windows pro driver? It is…
-
1
votes1
answer167
viewslist has not been declared
I’m doing the first part of a c++ work on codeblocks and Ubuntu and I’m getting the following errors: 1 - 'list' has not been declared 2 - no matching Function for call to 'No::verifieNo(int&,…
-
1
votes1
answer1787
viewsHow to create multiple . txt files?
How do I create multiple . txt files in c/c++ ? I have that function: tocopy(){ FILE *file = fopen("Teste.txt", "w"); fclose(file); } But it only creates a Test.txt file…
-
1
votes1
answer664
viewsPass Class Name by C++ parameter
I am having a problem, I need to pass the name of a Class via parameter, so that the function can create a new instance, this Class is daughter of another Class called Control. The problem is that…
c++asked 8 years, 7 months ago Pedro Soares 1,136 -
1
votes1
answer334
viewsOperator & and * in functions
What is the meaning of this & in front of the matrix (my function only works with &, I am overloading Cout<<(matriz1 + matriz2)) And the meaning also of the * in front of the void?!…
-
1
votes0
answers172
viewsopenGL - Save Complex Rendering in Memory for Future Restore
I am developing a c++ application using opengl, but my knowledge in c++ and opengl is limited, especially in the latter. I need to create a board similar to the chess board, however for each…
-
1
votes2
answers3887
viewsHow to use a switch inside a switch?
In case, I can not choose the option of the menu select difficulty, I am doing the switch correctly inside a switch? #include <stdio.h> #include <stdlib.h> #define TENTF 5 #define TENTD…
-
1
votes1
answer818
viewsDifference between void and void*
What is the difference between void* and void as type of return of a function? Example 1: void *func_nome(int param){ ... } Example 2: void func_nome(int param){ ... }…
-
1
votes1
answer45
viewsHow to remove element from a list?
I have a list of objects from the No class, and would like to remove an object from that list, I use the library list. I know of the existence of pop_back() and pop_front(), but they delete exactly…
c++asked 8 years, 7 months ago Dudu Lopes 37 -
1
votes1
answer129
viewsError assigning value to struct property in C++
I’m learning to code and, at the moment, trying to make a little game like the popular Nake. We need to increase several things in the program, such as the limits of the walls, collisions, etc...…
-
1
votes1
answer778
viewsC++ How to remove an element outside the ends of a list
I use the list library and am having trouble removing an element using remove(), or Erase(). With push_back() and push_front() it works, but I need to remove elements that are not at the ends.. I…
-
1
votes0
answers91
viewsWhere does the eclipse C/C++ generate the executable?
I want to use a relative to open a read file in the C/C++ eclipse, but I would need to know where the eclipse runs the file to put the file in that directory and use the line of code: ifstream…
c++asked 8 years, 1 month ago Antonio Gomes 15 -
1
votes0
answers83
viewsDepth algorithm - graph - DEFS
When applying the adjoining list algorithm in depth search - DFS with a set of vertices and their adjoining ones, the algorithm presents a result, if it changes the order of adjacent ones of at…
c++asked 8 years, 1 month ago Emanuel Rodrigues 19 -
1
votes0
answers58
viewsHow to link to SDL2 statically
With a simple sdl project, it just shows an empty window. I’m using the following Cmake (in Clion) : cmake_minimum_required(VERSION 3.3) project(AprendendoCpp) set(CMAKE_CXX_FLAGS…
-
1
votes1
answer63
viewsInvalid enumerator when trying to add a filter using WFP by C#
I’m trying to bear a code of c++ to c#. My goal is to block a website using WFP. After translating the code, I seem to have missed something because when adding a filter I get the message "An…
-
1
votes1
answer49
views -
1
votes1
answer440
viewsHow to order a struct within a struct
I am wanting to do ordering of a struct that is referenced within another struct: Detail: can be a sort using Selection Sort typedef struct{ int tipo; char dispositivo[50]; int prioridade; }Perif;…
-
1
votes1
answer91
viewsWhat is the C++ vector
The college professor asked to research the ordering scripts and perform tests with them, determining which is better in which situation. I found the scripts, though on the site the guy does not…
-
1
votes0
answers249
viewsHow to zoom in on an image with opencv and C++?
I have to program an algorithm to zoom in on an image without using the opencv tools, but I’m not getting it. How to zoom in on an image using for loops? Mat img = imread("copo.jpg",…