Questions tagged as 'c++'

1
answer

doubt about this code

referring to this code to calculate notes, but I have the second doubts, I know that the n is like a liminator (it's worth 2) but what does the aux and the n1 do? #include<iostream> #include<conio.h> using namespace std; struct alu...
asked by 27.09.2018 / 23:25
2
answers

Show array of objects with vector class

How can I display objects created in an array on the screen? The objects I want to build have two parameters defined by default initialized in the default constructor. What should I do? This is my code: std::vector <Garito> garito...
asked by 24.06.2018 / 13:03
1
answer

Operations linked lists

I'm with the subject of linked lists. Especially with the list simply linked. I have seen the typical operations that can be done with this type of structure: add by the beginning, by the end, eliminate nodes, display the list, search for elem...
asked by 21.06.2018 / 19:12
2
answers

Problem with a pointer to struct type

My problem is this: I want to implement a TAD that allows me to go through a data collection of type string , entering values at the end and in the header .h I have the declaration: typedef rep_string *coleccion; In the .cpp file my...
asked by 30.05.2018 / 19:23
1
answer

How do I fill a multilist?

I have a list linked to another list in this way: struct lista { int valor; lista *prox; } struct multi { int valor; multi *prox; lista *abajo; }; void insertarcabmulti(multi **cab, int x) { multi...
asked by 24.05.2018 / 17:31
1
answer

Segment violation (core generated)

I am applying the kmeans grouping algorithm and I am currently in the part of updating the centroids but I get an error of segment violation when I try to add the points of each centroid and divide it by the total number of points corresponding...
asked by 07.05.2018 / 03:00
2
answers

C ++: Matrix raised to square power

I want to make a program that based on a square matrix (same number of rows and columns) calculate the square power of that matrix. Code. #include <iostream> #include <stdlib.h> using namespace std; int main(){ int fila,column...
asked by 13.05.2018 / 22:15
1
answer

Modify length of a vector in c ++

I want to modify the length of a vector and at the same time delete the remaining elements if the new length is smaller than the original length of the vector. I do not know if there will be reserved words of the language to do this. It is with...
asked by 18.06.2018 / 01:05
1
answer

Pause in C ++ pause does not work when running the.exe

At the moment of executing the .exe of a program in c ++ it does not pause, that is to say it closes of blow and I do not understand because it happens since I have a "getch" and a (pause)) #include <conio.h> #include <stdio.h> #in...
asked by 15.04.2018 / 03:04
1
answer

Problem with arrays in visual studio (program problems)

When I want to set the limit of my vector with a variable, the program does not let me. This did not happen to me with code blocks. The code: #include <iostream> using namespace std; int main() { int save,num,c=0,digito,mayor=0;...
asked by 17.03.2018 / 03:45