Questions tagged as 'c++'

3
answers

Put "||" (or) in a while in C ++

I'm learning C ++. I was doing some experiments, including a program where there are 2 variables with a value of 100 and a number is randomly subtracted from these variables: #include <iostream> #include <stdlib.h> #include <tim...
asked by 14.09.2018 / 06:53
2
answers

Class prototypes can be declared in c ++

class A { B x; }; class B { A x; }; The compiler tells me that B is not a type.     
asked by 02.11.2018 / 04:29
2
answers

Doubts about the C ++ standards [closed]

I have a couple of doubts What is the most commonly used standard now? If I make a program for example in the C ++ 14 standard, will portability and code execution affect it?
asked by 23.02.2017 / 18:51
4
answers

Libraries and headers in c ++

I'm looking for information about C ++ libraries, but when I've read them I see missing headers like windows.h. What is the difference between a library and a header?     
asked by 25.05.2017 / 03:55
2
answers

Copy a word obtaining dynamic memory

I am trying to request that a word be entered and then create a new memory space to copy the word entered by the user there but I do not know how to do it. I have this: #include <string.h> // strlen, strcpy, strcmp, strcat #include &l...
asked by 27.03.2018 / 04:10
3
answers

Problem with struct in C ++

What type of error or omission am I committing in the code? Specifically in the statement% main% co_. Error which I have solved comparing the results one by one, which would be problematic when you have to compare more than 3 variables. #in...
asked by 23.06.2016 / 01:25
2
answers

Calculate tree height oriented C ++

I have a tree class to represent oriented trees (No binaries). The nodes are represented by a cell, which has the method lchild () that gives us the most left and right () son or simply increasing (as in list) to get his brother who follows him....
asked by 11.10.2017 / 16:18
2
answers

I get error [Error] no match for 'operator-' (operand types are 'std :: string {aka std :: basic_stringchar}' and 'int') calculate the age

#include <iostream> #include <ctype.h> #include<stdio.h> using namespace std; int main(void){ string nombre, segundonombre, primerapellido, segundoapellido, fecha; cout<<"Este Programa Te Dira Tu Nombre Completo"<...
asked by 25.04.2017 / 06:09
2
answers

Write to a vector and save info to a file

Good! I am trying to implement the recommendation that @eferion made in a previous question: Read string and floats of a file to calculate weighted average in C ++ But the IDE throws me several errors. The code is as follows: #include <...
asked by 05.06.2017 / 22:56
3
answers

Basic c ++ program to return if a number is greater or less than 10

Hello I just started in c ++ and I want to make a program that takes a number entered by the user through the keyboard and returns if it is equal, greater or less than 10, to learn how the language works. The problem is that I had achieved it un...
asked by 19.12.2016 / 23:10