Beginners - February 2021 (Page 4)

can someone help me
 
(sample) size: 5 First number: 5 5*4*3*2*1* __5*4*3*2* ____5*4*3* ______5*4* ________5* (I typed wrong,sorry.) (Don't care the _ , it's nothing.) This is my wo...
[12 replies] Last: Thank you. (by ayanokoji)
associative container?
 
What actually is an associative container, what makes it one? Is it just if there is a key value pair? Is it anything to do with how it is stored in memory? I c...
[3 replies] Last: > Is it just if there is a key value pair? Often, key value pairs, bu... (by JLBorges)
Function that can accept different paramter types possible?
 
Hello, I am back with more weird questions ... Is it possible to create a function that has one paramter (for example), but that parameter can be either Cust...
[8 replies] Last: I know that "overloading" isn't a bad thing ... I just meant that as a... (by leander g)
ROV that doesn't work properly
 
Good night from Spain. The first thing I would like to do is thank you for all the posts on this forum, and the help they provide in troubleshooting programmin...
[1 reply] : Too big and too many bugs to attach here, I put the Github page, where... (by asesorplaza1)
by kmce
overloaded << issue
 
I have overloaded the operator << but I am getting the error binary '[': no operator found which takes a left-hand operand of type 'const array<T>' (or there is...
[6 replies] Last: and to demonstrate exceptions: int main() { using std::cout; Sta... (by seeplus)
by JRManx
Overloaded + constructor
 
I am having an issue getting my overloaded + constructor to work. Here is the code: class Book { private: BookAuthor author1; string authorName; ...
[2 replies] Last: Yeah, just a few minutes after I posted, I aksed a friend of mine and ... (by JRManx)
by Unapol
can't figure out why only last part of if-else statement is doing anything?
 
hi, im learning c++ and this is part of a project i'm doing. i cannot figure out why only the last part of this if else statement is doing anything. no matter w...
[5 replies] Last: good! Make sure you understand this, it is IMPORTANT. c++ compiler A... (by jonnin)
getline function issue inputting string AND integer
 
Hello, I am trying to take in user input using getline(), but I am having an issue with the function. I want users to input a name and an ID associated with ...
[3 replies] Last: Without using regex, consider: #include <sstream> #include <iostrea... (by seeplus)
Binary Matrix Inscribed Circle
 
Hello! I am trying to define a binary matrix 512x512 with an inscribed circle centered in [0,0]. Nevertheless I am getting some troubles. Below is my current...
[4 replies] Last: SOLVED! for (m = 0; m < rows; m++) { for (n = 0; n < cols; n++) { ... (by DanielDeChamps)
The minimum position in vector of the number x
 
The program reads from the keyboard, on the first line, the natural number n. On the next line reads the string of n natural numbers, sorted in ascending order....
[3 replies] Last: Note that dutch's solution does optimize on assumption that both input... (by keskiverto)
read in text file, store as string/int/char
 
Can somebody tell me how read in a text file like this? I am using a combination of string, int, and char variables. Normally, when I have read in files like th...
[4 replies] Last: Hi Andy, I was initially using '%' to differentiate between the othe... (by FeedMeTacos)
by akeilo
Need help
 
This is the first part to my code and I was wondering what is wrong with my if statements. #include <iostream> #include <iomanip> using namespace std; ...
[2 replies] Last: akeilo; @jonnin is correct, you need a semicolon after pretty much any... (by JRManx)
by siid14
Fixed
 
When I use fixed, it does affect all other operations after it. Why? And how to have (fixed) just affecting the line 10 I'm targeting. #include <iostream>...
[3 replies] Last: Otherwise it will stay at 1. 6 is the default. I believe only the widt... (by dutch)
Linked List Copy Constructor
 
I have been trying to figure out how to write a copy constructor, but whenever I run it it doesn't compile. Logically, I feel like what I'm doing makes sense, b...
[1 reply] : If all your compiler says is "compiler error" then you need a new comp... (by dutch)
Fixing additional numbers added after reading in .txt file
 
So i created a program to read in from a .txt file with a few phrases in them, but when i get the computer to read them and print them to the screen the same 5 ...
[2 replies] Last: Hello CodeStart99, PLEASE ALWAYS USE CODE TAGS (the <> formatting b... (by Handy Andy)
by mlieqo
Initializing member with derived class
 
Hello, I have a program where I am trying to initialize member with derived class instead of base class, short example: class Parent { public: Parent(); ...
[1 reply] : Parent's test_func needs to be virtual. (by dutch)
Converting a integer with leading or trailing zeros to a string
 
Hello guys! First time posting! I am trying to have a user input ID information for a student, and for the ID it could be for example: 00000001 00123000 1234567...
[7 replies] Last: You need to think of the ID as a string, not a number. It's just a lit... (by dhayden)
by bstroe
Close pair
 
A pair of x values in the string on a card is a y number that is part of the same string and has the following property: - if x is in an even position, y is th...
[1 reply] : Sadly, "even" and "odd" don't reflect array indexing from 0. #includ... (by lastchance)
Inorder traversal for Binary Search Tree
 
Hello, I am trying to print my Inorder traversal for a given BST with commas separating each name, but I always get a comma at the last name to, for example: B...
[4 replies] Last: #include <iostream> using namespace std; template <typename T> class... (by lastchance)
by manhnt
Iterate through an array of unordered_map in C++
 
In my program, I intend to use array of unordered_map but fail in traversing through it. I initialize it as below: unordered_map<string,bool> mp ; for(int ...
[1 reply] : shudders at the use of l as a variable name Please show a minimal, ... (by Ganado)
February 2021 Pages: 123456... 12
  Archived months: [jan2021] [mar2021]

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