Beginners - February 2020 (Page 7)

how do I determine the type when auto was used
 
In the example code below auto was used I want to know the type to replace auto in this code. typeid gave me this: "NSt10filesystem7__cxx1115directory_entryE". ...
[7 replies] Last: Thank you, Ganado. (by Enoizat)
Beginner: Switch statement
 
Can someone help me fix my switch statement #include <iostream> #include <string> using namespace std; int main(){ string doucheAgaintry;...
[5 replies] Last: Hello cblack618, You are welcome. Now that you understand that bette... (by Handy Andy)
Is My Class To Bloated
 
Hi everyone, another Rubber-Ducky gut-check question from me. I am learning about Enums and I came up with a practice exercise to create a class that mode...
[5 replies] Last: Hi all, thank you both for those insights and points of best practic... (by ExponentialP)
by Kiryu
Template specialisation implementation
 
Currently I am struggling to compile the following snippet: Header: #ifndef TEST_H #define TEST_H #include <vector> class Test { public: enum Enum { O...
[4 replies] Last: Except for the typedef, which is of course not visible from outside yo... (by Enoizat)
How can I get filenames in directory?
 
What I want is to get the list of filenames in a directory. I'm using windows. Apparently system("dir") shows the list of files. But I don't need to show th...
[3 replies] Last: Thanks a lot Handy Andy. (by Rakib771)
by deputy
class/composition
 
Hey!! How can i add price from Computer class with Monitor class price and calculate it in Complect class.Kind a stuck in here.Thanks. #include <iostream...
[2 replies] Last: Thank you, it did help. (by deputy)
password restrictions homework
 
I am trying to figure out why the website that i have to submit my homework in won't accept this code below as an answer. Redundancy aside, the program seems to...
[5 replies] Last: wow, you were exactly right. The grading system was case sensitive. I ... (by zzzbluebb)
Need help with this class problem
 
I'm very new to computer science. My teacher gave us an assignment to greet someone, ask for their age, and determine what year they were born in. For example: ...
[3 replies] Last: Hello Joni852, Looking at your code I misunderstood the instructions.... (by Handy Andy)
Need help with input validation
 
I am trying to modify it so when i enter a integer with a letter like 202o it gives me an error message and tells me to retry instead of accepting it and moving...
[3 replies] Last: This function parse_number yields a double if and only if the argu... (by mbozzi)
by AJ24
If else statements problems
 
Pre-written C++ program that computes the largest and smallest of three integer values. The three values are -50, 53, 78. Instructions Two variables named l...
[2 replies] Last: if(num1 > num2 && num1 > num3){ largest = num1; } if(num2 > num1 &&... (by AJ24)
by Mugaru
Help
 
Hi there :-)! New to C++ and got a question. I guess it is really simple but i am looking around for a few days now and could not find the answer or anyth...
[3 replies] Last: oh, it can. you may need to make the OS think your program is a debug... (by jonnin)
Skipping functions
 
So i have to do a school project.. i need to create a program that calculates BMI and does other stuff involving that, i did what i thought it was right but whe...
[2 replies] Last: Function_C and function_D both define local variable peso and use it w... (by dhayden)
BEGINNER: Virtual function and polymorphic (1,2)
 
Can someone give me tips and pointers about how i should approach this assignment and steps I need to do ? Thanks In this module you learned how to crea...
[23 replies] Last: If I were just learning C++ as leisure your recommendation would be v... (by mbozzi)
Payroll Program Debugging
 
Hi, I'm working on a payroll program that uses OOP features. I'm aiming to read employee data from a text file and output net pay. I got an error message tha...
[2 replies] Last: Make file: # CMAKE generated file: DO NOT EDIT! # Generated by "... (by beulette)
Question about reading text files (1,2)
 
If a text file contains only 2 lines, is it possible to read each line into an array of characters separately? Like line one is stored in an array, and line two...
[20 replies] Last: #include <iostream> #include <fstream> #include <string> using names... (by againtry)
error use of deleted function - when pushing back a class with a vector<unique_ptr<base>> member
 
Disclaimer; I realize some users are against "using namespace std;" and I don't use it in my actual code, I just thought it was more clear for the example. M...
[4 replies] Last: Unique_ptrs do not have a copy constructor. They cannot be copied, onl... (by TheToaster)
by momof4
How to simulate gravity with multiple thrusts
 
I need a bit of logic help here. I'm working with a program to simulate gravity. the equation for gravity is v=gt+v* or the current velocity is equal to gravit...
[2 replies] Last: be careful. velocity vectors are what you need, not just velocity as... (by jonnin)
Simple classe question
 
Hi I'm new in c++ I create a class Shapes and child class Rectangle and Cercle. I want to be able to create as much as I want of these shape (ok maybe max 10...
[3 replies] Last: Wow thank you for your help. Without your help I'll never figure it o... (by vbourbeau)
input and output file
 
I wanna to write results of some calculation into a text file and then at the end, read them from text file and do some other calculation. But my code has an er...
[1 reply] : The problem is that you cannot read from an output stream (ofstrea... (by Duthomhas)
Problems with bad_weak_ptr, shared_from_this and constructors
 
A while ago I wrote this post: http://www.cplusplus.com/forum/general/265809/ And then because of the problems with that project, I moved on to work on anot...
[1 reply] : I'm familiar with the algorithm. However, as is the case with most ... (by mbozzi)
February 2020 Pages: 1... 56789... 13
  Archived months: [jan2020] [mar2020]

This is an archived page. To post a new message, go to the current page.