Beginners - March 2022 (Page 2)

by Pen72
Group of friends
There is a group of n people indexed by positive integers from 1 to n forming a network of friendship. Friendship of x and y is denoted by a pair(x,y), which...
Mar 26, 2022 at 3:34am
[2 replies] Last: How about vis = true; and vis = false; (by Pen72)
Need Help with Assignment. Now sure how to start
This assignment requires you to maintain ratings for products sold by a company. Each product sold is stored in an array. A rating for a product consists of ...
Mar 25, 2022 at 11:19pm
[3 replies] Last: You're given a lot of the data and function declarations already. Cop... (by dhayden)
When is memory allocated for a vector?
Greetings, I have a short question. If I simply declare a std::vector of N doubles, i.e. std::vector <double> (N); , when will the memory of N d...
Mar 25, 2022 at 10:33pm
[5 replies] Last: It's interesting to consider what happens when you add a bunch of valu... (by dhayden)
issues with dat file
solved
Mar 25, 2022 at 9:25pm
[14 replies] Last: Someone burned a bridge too far for us to reply. (by deleted account xyzzy)
Why does it break out of the loop?
Why does it break out of the for loop if I write a number that isn't equal to either 1, 2 or 3 (for example 4)? I understand why it breaks out of the loop when ...
Mar 25, 2022 at 3:42pm
[4 replies] Last: Thank you very much everyone! I will definitely read more about the co... (by gust3lis)
keeps sending out a random number
please help also i cant use global varables //Nico Kalin OConnell #include <iostream> #include <iomanip> using namespace std; int validate(int); int main() {...
Mar 25, 2022 at 12:58pm
[6 replies] Last: There are three ways to pass a variable into a function, two inherited... (by deleted account xyzzy)
When I enter a char the program goes infinitiley
I tried putting the cin.fail() incase so that I can stop the loop and let the user enter a value again but then its infinite loop void strassenMultiplicati...
Mar 25, 2022 at 12:48pm
[6 replies] Last: @freshman236784, I hope you know that in genuine (and worthwhile) Stra... (by lastchance)
Template
There was no detected errors on the code but there was still undefined reference problems: MAIN.cpp:(.text+0x64): undefined reference to `listsavitch::operat...
Mar 25, 2022 at 10:36am
[5 replies] Last: #include <iostream> namespace listsavitch { template<class Item... (by seeplus)
Unique pointer assignment operator
Just started learning about smart pointers and my professor uses the assignmet operator like this in the slides. unique_ptr<double> p{}; p = new double...
Mar 25, 2022 at 9:42am
[3 replies] Last: See https://stackoverflow.com/questions/22571202/differences-between-s... (by seeplus)
Native webrequests with WS2_32
I've been trying to create a back-end for a RSS Client I'm working on. I took a snippet of code for the basic architecture of the code (besides the code is also...
Mar 24, 2022 at 8:12pm
[8 replies] Last: I can imagine. I once built a parser that recognized spaces between in... (by alfanjui)
Counting unicode characters in an array? (1,2)
How can I count all characters in an array with Unicode characters? strlen() gives more and isprint() gives less value. I can't find the right one. In the code,...
Mar 24, 2022 at 6:57pm
[23 replies] Last: Thanks for your help. I learned a lot. (by bydrachen)
Deque-Implementation push-front
Hello fellow programmers, here I am again with another question. I'm currently trying to implement a class structure for a Deque with the two functions pus...
Mar 24, 2022 at 6:38pm
[7 replies] Last: Thanks a lot @jonnin and @coder777 that helped a lot and i figured it ... (by Mae4ashy)
Error with global string in multiple functions...
I declare a global string and give it a value "ABC" in Function1. When I try to cout it in my main function, it gives error: Terminate called after throwing an...
Mar 24, 2022 at 3:10pm
[2 replies] Last: Code looks something like this... Well, if it looks like that then i... (by lastchance)
vector: entering weights
Write your question here. Program goal: User enters five numbers. Store the numbers in a vector of doubles. Output the vector's numbers on one line, each ...
Mar 24, 2022 at 10:04am
[2 replies] Last: OP. L8 defines a vector that has 5 elements. L19 - pushes a new value... (by seeplus)
Bulgarian Solitaire
Been trying to do a Bulgarian solitaire c++ program with a default n value of 45 and it's been a complete catastrophy (I'm new and learning about arrays so keep...
Mar 24, 2022 at 9:31am
[4 replies] Last: Use std::sort(). See L77 above in lastchance's code. (by seeplus)
Triangular Random Number Array
Hi, this is for a project I was working on and I've ran into some specific issues with random number and I kind of need help with it Background: It is supposed...
Mar 24, 2022 at 8:43am
[11 replies] Last: Just plodding my way through step by step it ends up as the following ... (by againtry)
Passing array to function
Question 1: I was able to use a range-based for loop (RBFL) in main() for my array, but when I passed it by value (which makes a copy) to a function in PassArr...
Mar 24, 2022 at 1:36am
[13 replies] Last: https://stackoverflow.com/questions/5724171/passing-an-array-by-refere... (by againtry)
Converting 400 line VBA function to C++ (1,2)
I am trying to convert a 400 line VBA function to C++. I can't work out how to replicate this system in C++. I tried to convert each "gosub xxx" into a "void xx...
Mar 23, 2022 at 10:05pm
[23 replies] Last: I have decided to post a different module which exhibits the same desi... (by naturtle)
C++ Rational Class with Constructors
How am I supposed to implement a second constructor that converts "void" to rational (where input == 1)? I am a beginner programmer working on an assignment for...
Mar 23, 2022 at 1:42pm
[8 replies] Last: As a C++ solution using operator overloading, consider: #include <i... (by seeplus)
adjust list by normalizing
For this program I need to alter the values in a vector by dividing all of them by the max value. The input will start with the number of elements in the vector...
Mar 23, 2022 at 10:10am
[3 replies] Last: #include <iostream> #include <iomanip> #include <vector> int main()... (by seeplus)
March 2022 Pages: 1234... 7
  Archived months: [feb2022] [apr2022]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.