Beginners - January 2020 (Page 9)

Coffee Sales
 
For this assignment, write a program that calculates a discount for buying certain quantities of coffee. Consider the following scenario: A coffee company sell...
[10 replies] Last: Hello thank you for your help (by cblack618)
C++ BST using nodes updated
 
Hi, Im currently working on an assignment where we are tasked with creating a Binary tree structure program, in which, we can illustrate a typical folder archi...
[4 replies] Last: The task essentially: Explore tree data structure. Develop an example... (by dhayden)
Use traditional pointer instead of unique_prt
 
Hello, How can I use a traditional pointer instead of a unique_prt? using BoolArray = std::unique_ptr<bool >; I want to use similar this: using *BoolAr...
[2 replies] Last: unsigned theSize; cin >> theSize; bool *boolArray = new bool ; ... de... (by dhayden)
by mnnsa
how to find nodes of other subtrees?
 
I am trying to find all nodes that are not in subtree of a given node u. There is an undirected tree that contains N nodes. the tree is rooted at node 1. An...
[7 replies] Last: [quote=mnnsa]where i th value denoting the parent of (i+1)th node. [q... (by Enoizat)
Reading table from txt file.
 
Hello. I need help guys. I've txt file with data like this : 22 55 23 11 53 21 44 12 23 12 33 23 14 45 12 and i need to put in 2D array with size . ...
[9 replies] Last: ts working properly, but what if my data in file looks like this: 122... (by againtry)
populating char array without using string
 
Hi All, I'm working on a project that accepts grocery item names and prices and stores them in a char array. This is for school and we are absolutely not a...
[10 replies] Last: Things are clearing up. I went back and looked and you're right, I ma... (by closed account 1Ck93TCk)
compito fatto.
 
I have a problem with the final parte of main() and I don't understand why. These are the code with main and his header files. Is there someone who can help me,...
[11 replies] Last: Oh, yes, looking at the output it’s clear there’s at least another... (by Enoizat)
by ema897
Overload of operator!
 
I'm trying to overload operator! for my class, but I receive error: 'void myClass<T>::operator!(const char&)' must take 'void'. Is it possible to overload oper...
[4 replies] Last: > I have to make class 'Not' to simulate 'not' gate. I suppose that yo... (by ne555)
Cho xinhgais
 
Tạo mảng hai chiều 8×8 a xong gán cho nó bằng 0 Tạo 2 mảng 1 chiều h , c Nhập h , c Gán x= h , y=c Gán a = 1; Cho 1 vong for che...
[2 replies] Last: haiyen223's text, translated to English Create a 2 × 8 a 2 tw... (by whitenite1)
by ICantC
Game timer
 
hello, i'm making a text based strategy game in C++ 17 using SFML for audio and ncurses for the screen, but i'm getting really confused with how to implement a ...
[9 replies] Last: ok. That sounds like a good plan. what about something along these li... (by jonnin)
class className in another class header file
 
I have seen in many code samples this specific code declaration in a header file that defines a class and its properties and methods class Game; class Wi...
[5 replies] Last: Suppose an application refers to a window: class Application: Wind... (by dhayden)
by Bopaki
Not sure if my insert function does it's job okay.
 
I get zero output when I run my program. #include<iostream> #include<cassert> using namespace std; template<class Type> struct nodeType { Type ...
[2 replies] Last: insert is no good. depending on where you want to insert, which, if ... (by jonnin)
Having trouble reading content from to txt files and writing to a third. Using vectors
 
Basically need to read information from two files and write to a third one. Each file has specific types of information that I must cover in classes. Here is my...
[8 replies] Last: At line 80 you try to read an int from the start of your 'inf' -stream... (by nuderobmonkey)
by ema897
dynamic memory for a class object
 
Given a struct: struct Element{ string name; myClass *data; }; If I have an Element vector and I want to set field 'data' with dynamic memo...
[6 replies] Last: In my example, elements is an individual Element object, which contai... (by Ganado)
The Dev-C++ IDE / compier /runtime
 
I have downloaded DevC++ It installed alright I entered some test code It was compiled alright (no errors) When I run it nothing happens Please advise ...
[6 replies] Last: I deleted the newly download version, cleared up all the rubbish, and ... (by Paddy de Ridder)
Novice programmer needing some help
 
So here's my story. I'm not in school and not in the programming field. But I'm a novice programmer who just started working on C++. My background is Basic, QBa...
[5 replies] Last: <vector>? Maybe but it depends what the process is. I admit it's far... (by dhayden)
When to Use A Struct Over a Class
 
Hi all, I wanted to share a bit of a personal eureka moment I had yesterday, I'm still trying to get to grips with the language and I've been making progres...
[8 replies] Last: I took this code from an exercise I found online. Just because someo... (by dhayden)
menu selection not working properly
 
Okay so I'm making a game and I have a menu that allows you to chose from 3 different options. When I select settings and change the options inside of it, I can...
[10 replies] Last: @dutch No idea how it works perfectly for you when the only time you p... (by zapshe)
by mnnsa
forming sets of numbers
 
how to form sets of numbers in c++ if the input we give is like this 3//number of pairs to input 1 2 // belong to same set 4 7 //belong to same set 8 7/...
[10 replies] Last: #include <iostream> #include <fstream> #include <sstream> #include <v... (by lastchance)
by Tom001
Problem reading from class
 
I get an error-type problem from the following code from the data (ifstream class) variable. Hope someone can point out what is my wrong doing #include <iost...
[7 replies] Last: On line 7: Matrix(std::string a) : path(a) {}; Prefer to make single... (by mbozzi)
January 2020 Pages: 1... 789101112
  Archived months: [dec2019] [feb2020]

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