Beginners - May 2020 (Page 9)

sum of last and first digit of a number using recursion function
 
HEllo. i wrote those functions which look like recursive functions but i'm not satisfied i feel like it's not recursive, is there a way to write only one recurs...
[4 replies] Last: #include <iostream> int sum_first_and_last(unsigned long n, int top... (by dutch)
Interdependent Classes (1,2,3)
 
Ok, so I have a class Player and a class Potion, and Potion affects Player, but Player holds and uses Potion; how do I declare them in a way that that doesn’t...
[40 replies] Last: sry forgot to close lol👌 (by highwayman)
how to make it stop (1,2)
 
So I've got this code here, it's a stopwatch. And the only problem with it is that it doesn't stop. I would like it to stop counting time when I, for example, p...
[24 replies] Last: Lines 60 to 63 is what you talkin about I think. Just replace it with ... (by highwayman)
Loading words from a file into an array
 
I am currently in intro programming and I'm really having trouble with pointers and arrays. For this assignment, I'm not sure if I'm loading the words into th...
[9 replies] Last: Regarding what size_t is, let's check cppreference: https://en.cppre... (by deleted account xyzzy)
How To: Prevent duplicate coding
 
I am rather new in programming and wonder how to compact the code I wrote for using a flexible number of CJMCU-8110 connected to my NodeMCU. In the attached tes...
[7 replies] Last: All works perfect. Only had to change vector<CCS811> vec_of_CCS811(s... (by KapakoProf)
Beginner char Menu function
 
I'm still not that with functions,i know i'm doing something wrong here. i'm trying to write a menu function that the user has to enter a character and if state...
[4 replies] Last: Thanks :) (by FoaaD2506)
Recursive function troubles
 
Good afternoon, I was recently assigned a project that implements a recursive function in order to reverse the contents of a vector. Here are the instruction...
[12 replies] Last: apparently that function i wrote was so hard core that someone thought... (by markyrocks)
Magic Squares
 
Hi, trying to set up a boolean return function that lets me know whether the contents of a multidimensional array are a "magic square" (sum of all rows, columns...
[9 replies] Last: @itsArtem, I used to think that, but it's so common in beginner progra... (by dutch)
Iterating through the contents of an array with a for loop
 
What am missing? I only get the string message Shouldn't I get something else too? #include <iostream> #include <string> #include <array> using namespace...
[2 replies] Last: Now I understand what they are having us do this for thanks (by Programmingaddict)
Quick question on what this statement does
 
I found this code from another source, and I was just wondering if I can get a quick explanation on what it does exactly. "skip" is an int data type. This s...
[2 replies] Last: Oh. That makes more sense. Thank You! (by closed account jEb91hU5)
use std::is_permutation() for unit testing?
 
Hi I'm writing some unit tests where the method tested should return a vector of objects. The method does not guarantee the order of the objects in the retur...
[3 replies] Last: If your correct vector is already in order, then sorting the result ... (by dutch)
Circular Array Shift
 
Did some searching but couldn't find anything helpful. Trying to write a helper function for a project that basically verifies if two arrays are in the same ci...
[6 replies] Last: Yeah, I wish I could, I just have a ton of homework that's due by midn... (by dakotad8218)
by Mif
What do I miss?.. I get 2 warnings. Please Help..
 
I'm writing a program in C++ Win32 and I was at the status bar creation .. when I build to see if it works, (and that's what it does), but I get 2 warnings.. T...
[5 replies] Last: You're welcome. Glad it helped! (by MikeyBoy)
by medosz
returning true or false value
 
I could not return true or false value instead of 1 and 0 with a function. Could someone help me with that please? #include <iostream> #include <iomanip>...
[2 replies] Last: Thank you. (by medosz)
by sachab
Class and private member access
 
Here is an example from this site's page on classes which illustrates what I am trying to figure out. I have added a line in which I attempt to modify the strin...
[6 replies] Last: priority_queue(i) This suggests that you're just guessing at what f... (by Repeater)
Class inheritance
 
I want to override the Accuracy and the Damage. What am I doing wrong here? Is the only way to override the attributes is to use a constructor? class Pist...
[1 reply] : class Pistol { public: struct Attributes { // something... (by keskiverto)
by lam814
Done
 
Done
[2 replies] Last: After a quick look at your horrifically-spaced code I spotted a couple... (by dutch)
Undefined Symbols Error While Creating Class
 
Hi! I'm just trying to create a simple class using header a file and I'm encountering an error every time I compile. The error is "Undefined symbols for archite...
[14 replies] Last: ^^That did it! Program compiles and runs as expected now! Thanks, eve... (by capnation)
by CToks
A matrix of white crosses that I want to remove
 
Hi, very new to C4D. Tried googling but not hitting the right jargon. I applied matrix to a sphere and then deleted the effect. A lot of small white crosses...
[no replies]
by mpelle
My code is out of bounds but I don't know how to fix it.
 
This is my first time using a forum like this, but I'm desperate. My code below is meant to delete either the odds or evens in a vector of randomly generated nu...
[12 replies] Last: Here's another way of doing it. So you're trying to delete, say, all t... (by Ganado)
May 2020 Pages: 1... 7891011... 17
  Archived months: [apr2020] [jun2020]

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