Beginners - March 2022 (Page 6)

loops: countdown until matching digits
 
Goal: Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output...
[3 replies] Last: thanks @thmm !! I think that was one of my main issues!! ---- Here's t... (by seaminusminus)
Help with simple calculator (if - else)
 
The teacher wanted us to make a simple calculator. But he wants it as short as possible. Can I go shorter than these? Input: 3+5 Output: 3+5=8 is a must. ...
[8 replies] Last: good luck! I was trying to say that originally ... too short usually ... (by jonnin)
Understand while loop and storing arrays.
 
Hi! First of all I'm new to programming, yeah thats why it's the beginners forum, and try to sort things out. I have taken a distance course so much of the help...
[5 replies] Last: Instead of having a bunch of if/else statements a switch reduces the n... (by George P)
Inheritance, calling a children method from parent
 
Hello, I am new to the forums as recently started learning C++, and I am trying to wrap my head around C++ from a C# developer perspective. I am making a gam...
[8 replies] Last: depending on what you are doing, static (keyword) class variables alwa... (by jonnin)
how to delete a specific line from a txt file
 
I've stored data in a text file, but I've got a requirement if the input, say a is seen in the file already( I know how to do that), delete the line, how would ...
[4 replies] Last: I've stored data in a text file, but I've got a requirement if the ... (by dhayden)
Saving structs to files
 
I have this struct and I wish to add info about an undefined no. of albums (meaning I couldn't have an int n where it'd just stop reading). This information wou...
[5 replies] Last: If you go with binary, I prefer the fixed size if you can nail down a ... (by jonnin)
by Spyrex
Own CMAKE library
 
Hey, I am relatively new to cpp. I programmed some classes I want to be able to build to a separate library I can use from another cpp project. This my dire...
[no replies]
New to file input/output, dont know where im going wrong.
 
Doing an assignment that merges two text files and i cant figure out why no text is being outputted to my merge file. Please give me a hint/pointer to what im d...
[3 replies] Last: It's easier to write the merge in two loops. The first for when neithe... (by DizzyDon)
initializing static variable
 
I was first introduced to keyword static when going over singleton classes and then saw it again when trying to prevent a class from instantiating on the stack....
[1 reply] : The reason is that variables are normally only allowed be defined once... (by Peter87)
Random Number Generator
 
I have this function to generate a random number seeded at the time of the computer, and I use this function several times with the same parameters. However, si...
[7 replies] Last: @ anup30 Do you like going backwards? It really helps to read the thr... (by Duthomhas)
[solved]Calling a copy constructor using 'this'
 
I have my copy constructor defined like so: CardStack::CardStack(const CardStack &pCS) { foreach(Card c, pCS){ this->append(c); } } ...
[5 replies] Last: If you are talking about the tutorial here at CPlusPlus, yeah, it ain'... (by George P)
by Ganado
watching
 
Answered in other thread: http://cplusplus.com/forum/beginner/282490/ [Well, I don't agree with whoever decided to be the judge, jury, and executioner here (un...
[1 reply] : Answered, and the OP was ejected by a large boot. (by George P)
by Ganado
beginner tpoic?
 
What are the errors? Copy and paste them for us next time. Your binaryK function returns a vector<int>, but you never use this. If you need to treat a vector a...
[8 replies] Last: It doesn't matter now, someone gave the OP "The Boot..." [quote=jonni... (by George P)
by Bazi
C++ coin game using inheritance
 
Code instructions: The Coin class will act as the base class. Three child classes will be created using the Coin class as the base class. The classes will be ...
[4 replies] Last: #include <iostream> #include <string> #include <ctime> class Coin { ... (by againtry)
HELP ME WITH THIS PROBLEM! (CHEMISTRY CONVERSION)
 
Zinc (Zn) is a silvery metal that is used in making brass (with copper) and in plating iron to prevent comosion How many moles of Zn are there in 23.3 g of Zn?...
[2 replies] Last: Well as a starter for part 1): #include <iostream> int main() { st... (by seeplus)
Do while loop
 
I'm trying to make a program using do..while loop that asks user for two inputs. Then print from 1 to the first number the user entered or until the first multi...
[4 replies] Last: Alright man, that works perfectly. Thank you for the help, appreciate ... (by daddymomo)
I solved SoloLearn Problem on VS code and when i entered code on their platform it didnt work.
 
So i was solving this SoloLearn Ticket office problem with C++. here is problem: "~You are working on a ticketing system. A ticket costs $10. The office is ...
[6 replies] Last: [quote=seeplus]the start min is the more than any valid min. The inpu... (by keskiverto)
Overloading the Addition operator to add 2 arrays of numbers
 
So for a task for school, I have to create a type class that can handle large ints stored as a dynamic array of shorts. I have hit a snag on the addition operat...
[3 replies] Last: That constructor takes one argument, so it can't be the same construct... (by lastchance)
Need help debugging a project on C++
 
Code: https://github.com/Kaiser808/cpp Assignment: https://filebin.net/d7wkeca4r1ydbsxx I need help debugging these files. I got help from someone on Cheg...
[13 replies] Last: Thanks a lot for the help @salem c (by Kaiser89)
by Ganado
Passing arithmetic function objects into map
 
There was this question here, asking about how to make a particular piece of code shorter: http://cplusplus.com/forum/beginner/282476/ Just for fun, I was tryi...
[2 replies] Last: Yep, that works. Thank you. Apparently lambdas work, too: http://www.... (by Ganado)
March 2022 Pages: 1... 4567
  Archived months: [feb2022] [apr2022]

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