Questions tagged as 'c++'

2
answers

Read file (.txt) C ++

My problem is this: void read () { string name, ciudad; int cont = 0; ifstream read; reader.open ("usuarios.txt", ios::out | ios::in); if (lectura.is_open()) { while (!reader.eo...
asked by 19.04.2017 / 20:40
1
answer

I want to know why it does not print the complete array with my dynamic pointer in c ++

When I run the program, it does not print the last line on the screen. For example, if I tell you to make room for 3 string then just ask me two times and print only 2 the first two strings that I type. I want to know why this happens...
asked by 08.03.2017 / 17:22
1
answer

Error when implementing a TAD Point in C ++

The exercise consists in implementing a TAD Point, with the operations abscissa (returns the x), ordered (returns the y) and distance (calculates the distance between two points). The exercise is simple and this is my code: file: dot.h #...
asked by 22.03.2017 / 01:03
1
answer

Does not my file save an entire value in C ++?

My program consists in creating a file .dat , with 3 values (name, age and country), read the file and show its contents. The problem I have is that when I open my file, it only saves me the char values. I think the error is in getch...
asked by 20.02.2017 / 16:39
1
answer

Classes with "Public Members" ERROR! Expected Expression

I would like to find the error or what my code lacks in order for it to compile successfully. #include <iostream> #include <string> using namespace std; class Student { public: string firstName, lastName; int dob; int...
asked by 04.02.2017 / 18:21
2
answers

Linking errors in C ++

Hello I am trying to compile my project using an additional library first I generate the compiled code of my program: gcc -o programa.exe Dynamic.cpp Then I add the library to my program: g++ -o programa.exe Dynamic.o hook.o But it sh...
asked by 14.03.2017 / 22:18
1
answer

How to use the "pointer formalism" to calculate the average of a table?

I have an exercise in C ++ / C to make the average of an array using the "pointer formalism" ("formalisme pointeur" in French). For example, this next one uses the "pointer formalism" to manipulate the table: int tab[10]; for{int i = 0 ; i &l...
asked by 10.02.2017 / 18:14
1
answer

RegSetValueEx I can not create a rule in registry using QT

Hi, I am using RegSetValueEx to create my rule in register using Qt when I use codeblocks, but when I create it with Qt it gives me a conversion problem, the code is as follows: string subclave="Hello"; string valor="Anyone"; LPCTSTR _s...
asked by 04.02.2017 / 12:35
2
answers

Read only the first word of cin

Good afternoon, I am writing an interactive program directed by commands. Some of them have arguments but others do not. I leave the code of my function main to give you an idea. int main(){ char comando[10]; ListaPersonas L...
asked by 31.12.2016 / 16:03
3
answers

How to add file to c ++ program, with classes?

How to connect a text file (not binary), that stores data entered by the user in c ++, in this simple example: #include <iostream> #include <string> #include <conio.h> #include <stdio.h> using namespace std; class pers...
asked by 24.12.2016 / 15:25