Questions tagged as 'c++'

1
answer

My crash program at the end

I am learning to program C ++ and I have written the following code. Everything runs fine but in the end (when the tenth value is admitted) it stops working. I am using MSVC2015. Can you help me with this, please? #include "stdafx.h" #inclu...
asked by 28.11.2016 / 01:37
1
answer

Save a variable a first and last name that the user enters

I need to make a program in which the user enters their full name, their age, and print on the screen:    "Lord" name "your age is" age I'm learning string of characters, but I'm not sure how to use them. C ++ Code: #include <io...
asked by 22.11.2016 / 17:12
1
answer

Store text variable in a char array

Good I am doing a problem that they left me in the university which asks me to develop a program which must store in a variable the text: "Pablito nailed a clavito. What clavito nailed Pablito? "As arrangement char. I think that it is already, t...
asked by 12.11.2016 / 06:10
2
answers

Error "no match operator []" when entering data in a map inside an object

I'm trying to save data on a map inside an object and I get this error in var [name] = val and in var [name]:    no match operator [] header #include <string> #include <map> using namespace std; class Calculator{ public:...
asked by 16.11.2016 / 07:57
2
answers

Thread in c ++ compilation error

I'm starting with threads and I've been following several steps and I think it's all right, but when it comes to executing it, it gives me error . The code: int main() { int num_it, num_threads,energy=50000; string sequence; c...
asked by 13.10.2016 / 17:07
2
answers

Is it possible to capture a segfault with try / catch?

To check if it is possible I did the following: try { int *x = 0; *x = 1234; } catch(...) { cout << "OK"; } But when I run it, I get a segfault in the same way. I've read in some sites that try / catch can not capture a se...
asked by 20.10.2016 / 04:20
3
answers

what is it used for #ifdef_MSDOS_ in c ++?

I have had problems because where I work they use a version of dev c ++ 4.9 and I use 5.1 in my home, I searched the internet to insert the code as a #ifdef header ..., can someone tell me how to use it and if Can you solve my problem?     
asked by 13.09.2016 / 16:59
2
answers

How to read a line in a specific file in C ++?

I made an agenda where I saved data in a text file. When you find the name of a contact, I want you to read all of your information. But I have no idea how to read just one line. I appreciate any help, thanks. (Code in codeblocks) #include...
asked by 07.11.2016 / 15:00
1
answer

Error compiling program in C ++

This is my program. I am using CodeBlocks. The errors that it shows me are the following: 26 - expected primary-expression before 'int'. 26 - expected ']' before 'int'. 26 - expected ')' before 'int'. 26 - expected initializer before '...
asked by 01.06.2016 / 10:41
1
answer

invalid read of size 1

After seeing many similar threads, I can not properly resolve this error message from Valgrind (memcheck): ==397018== Invalid read of size 1 ==397018== at 0x527689D: JUMP_TO_L3_EXT_HEADER(unsigned char const*, unsigned char, unsigned long)...
asked by 30.06.2016 / 10:13