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
votes0
answers67
viewsHow to implement in C++ and use in C# in VS?
EDIT: I want to implement in C++ (no limitations, using intrinsics, inlines, optimizing and everything else normally), choose what in what has been implemented is visible in . NET (C# at least) and…
-
0
votes0
answers27
viewsHow to correct __imp errors?
I found on github an HTTP/HTTPS library header (https://github.com/yhirose/cpp-httplib), which says it is only necessary to import it into the archive and use it. I created the code: #include…
-
0
votes1
answer55
viewsHow to make fwrite only write the character instead of the entire record?
I’m making a code that reads a file with records of fixed size (storing in struct hist), and inserts them into another formatting file so that they have variable size. To indicate that the struct…
-
0
votes1
answer36
viewsRTS/DTR C++ control
Performing an integration of an RS232 device, we found an obstacle that is related to the flow control using the RTS and DTR with the equipment. Using the Escapecommfunction function to manipulate…
-
0
votes1
answer37
viewsFilter string array in C and count how many repeat
The program makes car rentals, it takes license plate and the type of car, both stored in two different matrices, as I do to get only the license plates of the luxury type cars. Code I’ve made so…
-
0
votes1
answer27
viewsHow do I get the spaces just from the last column of the matrix?
Iai galera, so my code is already working perfectly, but in the last column it also gives a space, but I do not want this space there, as I do to remove it? Leaving only spaces between numbers.…
-
0
votes1
answer43
viewsVector problem in C++
I’m doing a code to create password and user, of course saving them. But in this part of the program it does not work, it gives error. void criar_senha(){ cout << "Digite a senha usando letras…
-
0
votes0
answers30
viewsHow to read txt with color palette to apply to another txt with characters?
I need to read the color palette file, something like: . 0 0 64 x 255 255 0 0 0 0 where each symbol in the first column represents the image in another txt file. Where it has ". x o" need to be…
-
0
votes2
answers192
viewsSum of numbers in a range C++
I need to make a program with a recursive function that takes two integers as parameters n and m, where n <= m and returns the sum of the numbers in this range. For example, if n = 1 and m = 4…
-
0
votes1
answer43
viewsError type char C++
Hi, I’m getting this error when I try to save a character from a txt. error: request for Member ĩc_str' in’d[j]', which is of non-class type ĩchar'113 | fscanf(iFile, "%c", d[j]. c_str()); Below is…
-
0
votes1
answer56
viewsHow to pass fstream variable to another function?
I am trying to pass a binary file that is already open to a function. However, I get the following error: error: use of Deleted Function. Code: void abreBin(){ fstream arq_bin("registro.bin",…
-
0
votes1
answer29
viewsSWIG - How to convert primitive types that are passed by reference?
I’m using SWIG to be able to use a C++ code in C# (Ogre3d for the curious) I have the following method in C++: bool suggestTangentVectorBuildParams(VertexElementSemantic targetSemantic, unsigned…
-
0
votes0
answers36
viewsC++ Member declaration not found
I started in the language c++ a short time and I am doubtful in methods specializations, I have two header files, arrangement and student, I want to use 2 methods of arrangement in student, but when…
-
0
votes0
answers29
viewsThis algorithm of mine isn’t reading my file at all, it’s only reading from the 435th line to the 990th line
#include <cstdlib> #include <iostream> #include <fstream> using namespace std; typedef int TipoChave; typedef int TipoDado; typedef string TipoNome; struct TipoRegistro { TipoChave…
c++asked 3 years, 8 months ago Odivan Marcos Gomes 1 -
0
votes0
answers48
viewsI wanted to know how to pass an array as a parameter where the user will type the order
The code I had made is here. I set the max 5. Yeah, it’s the max of the exercise. #include<stdio.h> #include <stdlib.h> #define MAX 5 void exibir(int num, int jogo[][MAX]) { int i, j;…
-
0
votes1
answer39
viewsWrite class data in file . dat, and at each use check if the information exists
Good night, you guys. I’m writing a code for a university project. However, I’m having trouble manipulating the file in C++. I created a class called Stok and the amount of objects to be created are…
-
0
votes0
answers31
viewsHow to access the getter and Setter methods of one class through another in a generic C++
I would like to be able to assign and/or retrieve values of an object through another class, where I can declare which properties I would like to access, their types, the method to access the…
c++asked 3 years, 7 months ago Sileno Brito 1,437 -
0
votes1
answer26
viewsProblem changing characters of an array
I have a problem where given a 10x10 matrix, it has to be filled with asterisk characters and the’t'. In this matrix, ONLY the characters with the coordinates that have t' and that are neighboring…
-
0
votes0
answers24
viewsGet specific value from a file
Hello, how are you? I have the following file format: username=teste1; status=ONLINE; username=teste2; status=ONLINE; username=teste3; status=OFFLINE; Where one of the lines represents the user name…
-
0
votes0
answers55
viewsProgram enters Infinite Loop - Problem "Horse Ride" in C
The problem of the horse consists of which, the horse is placed on the board emptiness and, following the rules of the game, need to go through all the houses exactly once in consecutive moves. ie…
-
0
votes1
answer43
viewsprinting twice with for()
i tried to make 1 code to be possible to register several projects (maximum 10) and several users being at most 4 and I wanted after all registered he presented them on the screen, 1 per 1, however…
-
0
votes1
answer33
viewsVector exchange of chars with problem
I’m trying to sort this struct vector that has random int values and a char vector also with random values. But I ran into a problem. The idea is to sort them from the random numbers and the letters…
-
0
votes2
answers55
viewsMake an If in c++ by limiting the answers
The user types the year, month, day and temperature, but I need to limit the answers. ano may not be less than 1850 and greater than 2021 mes may not be less than 1 and greater than 12, dia may not…
-
0
votes1
answer53
viewsString array printing error // C++
I am making a force and in the printing of the drawn word, there is an error in which the words are printed with some numbers or letters not included in its scope. const int quant_palavras = 3;…
-
0
votes0
answers36
viewsHow to resolve Signal: Segmentation fault (core dumped) in C++
I’m trying to make a noose and on that part, always gives the core error dumped. how can I solve this problem? cout << newnome1 << ", ESCOLHA UMA PALAVRA: "; cin >> palavraSecreta;…
-
0
votes1
answer53
viewsHow to convert an entire string to uppercase characters without using loop?
I have the following code: #include <iostream> #include <ctype.h> using namespace std; int main() { string nome = "pedro", up; for (int n = 0 ; n != nome.length(); n++) { up +=…
-
0
votes0
answers25
viewsHow to use a C# DLL in C++ using COM
In my project I am developing interoperability between C# and C++ in a single Library. In C++ my C++ functions and functions could bring to C# while C# methods could bring to C++, for example…
-
0
votes1
answer37
viewsUsing Function that did not have the library included in C++
I was reading about the function max_element in the documentation of C++ which is a function that points to the largest element in a list, vector, etc... And there it said that this function belongs…
-
0
votes0
answers29
viewsI cannot compile glfw with a Makefile
Hello, a few days ago I felt like learning opengl, and discovered glfw and Glad. I decided to use them to make a little game. Most tutorials nowadays only talk about how to use them in Visual…
-
0
votes1
answer42
viewsWhat kind of pointer is that?
I have the Following Code: int main() { string animal = "cabrito"; string &pn = animal; pn = "bode"; cout << animal << endl; return 0; } That generates the output: goat I was very…
-
0
votes0
answers22
viewsWinapi - Receive the process name and PID in C++
I am working on Windows processes, detect process, receive image name (Program) and your PID using Winapi. #include <windows.h> #include <tlhelp32.h> #include <tchar.h> #include…
-
0
votes1
answer51
viewsFunction that adds digits of a number - C++
Good evening guys, I’m working on a program that generates a 10x10 matrix, with numbers between 100 and 999, and finally that I make the sum of the digits of each generated number, ex: if it came…
-
0
votes0
answers34
viewsHow to delete an element of a vector in C++, permanently
I don’t know much about the "pass-by-value" of C/C++, and I don’t know when to pointer or not to a function argument. Next is the code I have: Struct Customer { .... } int get_nearest (int n,…
c++asked 3 years, 3 months ago Pirategull 659 -
0
votes1
answer10
viewsInitialization list of members with attributes from another class (inheritance)
I know a member startup list declares and at the same instant initializes such an attribute(s), that’s what I know so far. In the following code: #include <iostream> // std::cout class Foo {…
-
0
votes1
answer19
views"typedef typename" equivalent in C++03
Good morning. I’m having problems with a library code I want to add to my project. I use Visual Studio 10, which is a bit old, with a C++ version even more. The library code follows the format:…
-
-1
votes2
answers180
viewsC++ compiler
I am starting the Information System course and would like to know which compiler is best to use, as the teacher has passed several and has not specified which is best?
-
-1
votes1
answer107
viewsProblems with Dev-cpp
I installed Dev-Cpp 5.5.1 and it presents an error like this when I try to compile: "Failed to execute (and the file path)". Can someone help me with that? I already tried version 4.9.9.2 and the…
-
-1
votes2
answers167
viewsscanf shows number always as pair
I have a problem and I don’t know how to solve it because I’m starting to use Dev-C++ now. I don’t know much about him, the problem is the following I managed to solve an error I was having, which…
-
-1
votes1
answer1164
viewsError: cannot Convert float* to float
Error is on the line: quadrados = (desvio_qualquer * desvio_qualquer); Error: Cannot Convert Float* to Float #include <iostream> #include <string.h> #include <sstream> #include…
c++asked 10 years, 5 months ago Henrique Melo 73 -
-1
votes1
answer490
viewsRead the elements of a struct in another function
I need to access data from struct in my job CalcN, how should I proceed? int main(){ int calcn(); struct user1{ string Nome; int Dnx; int Nxhu; }; struct user1 x; x.Dnx = 4; x.Nxhu = 3; int…
-
-1
votes2
answers7835
viewsWhat is the difference between c and c++
I am starting in programming and would like to know the difference between c and c++ and which should I start to facilitate studies.
-
-1
votes2
answers205
viewsLanguage that Autodesk software uses
I’m wondering in what language the Softwares da Autodesk are written and the name of the GUI used. If you can help me with this information.
-
-1
votes2
answers126
viewsStd::out_of_range error when using substring C++
I have a file txt containing the following type of information on each line: Example: John-88888888 I need to read every line of that file and separate the name in a variable and the number in…
-
-1
votes2
answers171
viewsAdd a char on a char pointer in C/C++
I need to add a char on a pointer of char. For example: I have a pointer of char called name, which receives "log", after the process, I want it to be "log1". I tried to implement it like this, but…
-
-1
votes1
answer2601
viewsHow to compile code using Sublime?
I wonder if I can add a compiler to the sublime to compile things straight from the program, more practical like this.
-
-1
votes1
answer290
viewsPorting Java code to C++ or Python
I’m working on a project that was originally written in Java. I want to learn more about the mathematics and the logic behind the code, and I had the idea of porting the code to another language. I…
-
-1
votes1
answer95
viewsproblems after compiling C++ with the G++ compiler
I have a problem here after compiling a program in C++ using the compiler g++, after compiling everything, I try to open the executable file, then open my windows cmd (using windows 10)When the…
-
-1
votes1
answer81
viewsWhat’s wrong with this code?
Why this code is not being compiled? #include <iostream> using namesapace std; int main(){ long long xm; long long ym; long long xp; long long yp; cin>>xm; cin>>ym; cin>>xp;…
-
-1
votes1
answer379
viewsHow to read multiple lines in c++ without using file
I need to make a program in c++ that reads a multi-line input and stores each line(string) in an array. I’ve tried using the cin.eof() and fgets() but it didn’t work. #include<iostream>…
-
-1
votes1
answer286
viewsIs it possible to compile C/C++ from Windows/Linux for Macos?
In a hypothetical environment where I don’t have the system or how to emulate, would it be possible to compile an application in c++? (properly compatible) I’ve already found some cross-compilers…