Beginners - November 2019 (Page 5)

by vysero
Variable instantiation
 
I am confused about some feedback I got: "Member variables should be instantiated in the class co...
[11 replies] Last: as far as I remember, variables are initialized and objects are insta... (by MikeyBoy)
Deep copying vector of pointers to fewer objects
 
I have been researching how best to implement a design I have in mind for a class, in which I need t...
[2 replies] Last: for K in range(len(v)): index = find(v , v[0:K]) //looking for a ... (by ne555)
C++ #include <regex> Usage - replace_regex()
 
Let's say I have a text file with the format: horsey"test"log And I want line to be: "test" I woul...
[4 replies] Last: pos1 = s.find("\"", 0); will give you the first " then pos2 = s.fin... (by ne555)
by Hajo93
Struck with input
 
I'm in the process of creating a code. Where I can enter student number, name and age. It works as l...
[1 reply] : Just use C++. #include <iostream> #include <string> using std::stri... (by Repeater)
getting program to end loop and count properly
 
Hello, I am a new student learning C++ and I am having trouble with my program for a class that uses...
[4 replies] Last: I keep getting an error code when using != int the strcmp That's not ... (by coder777)
Change color of the text that user inputs when prompted .
 
So when the user is prompted to input data using their keyboard. That input appears on the screen. I...
[3 replies] Last: Hello mdh1559, The code used in the article is nice, but a bit long. ... (by Handy Andy)
Evaluating post/pre dec/increment
 
This is driving me NUTS!!! Why are different online compilers giving my different results for this c...
[6 replies] Last: If that is the case, then, as x appears in that chain before increment... (by lastchance)
List sorting problem
 
Hi, I'm not sure how the sort() function for list objects works. I'm trying to sort a list of album...
[10 replies] Last: Thanks for the documentation. I learned several things. (by jjordan33)
by raneie
Arrays with integers and strings?
 
Hi! I'm working with arrays and I'm wondering how I would put an integer and a string into the same...
[7 replies] Last: I did the entire project again but with what you suggested jonnin and ... (by raneie)
Recursive timer implementation
 
I have a quick question on how I can implement a timer where it will keep track of and display how l...
[1 reply] : Something like this, perhaps: #include <iostream> #include <ctime> #... (by JLBorges)
Help With Class Interactivity!
 
I'm trying to write a program that deals with information from two separate classes. There's an emph...
[1 reply] : Main #include "header.h" int main() { int counter = 0; int ... (by confundido)
by Frrag
getline dosn't work
 
i have problem with reading the line of file; the file: https://pastebin.com/D9L1ScWW file testing...
[7 replies] Last: You need to use an endl (or at least a flush ) after printing the ... (by dutch)
by obeeey
Global variables
 
Hello, I have a problem with declaring a variable which can be used in functions. Let's say I want ...
[1 reply] : Your compiler should not be having a problem with line 7. #include <... (by deleted account xyzzy)
UML class diagram to code translation (1,2)
 
Hello Everybody, I have translated the following class diagram (click on the link below) into c+...
[23 replies] Last: we can circle back to it but even with advanced algorithms like that, ... (by jonnin)
Dividing contents of 2 dimentional array into one array
 
Why does my avgHi array output zero if I divide the contents of the two arrays but if I add or subtr...
[2 replies] Last: Thank you. I was able to fix this by adding (float) to one of the numb... (by Esmith0550)
Take in 'x' amount of a string and reverse it
 
Hello, folks. The main objective I am trying to accomplish is taking in a user string and saving the...
[5 replies] Last: #include <iostream> #include <string> using namespace std; string ba... (by lastchance)
Random number for 10 to 99
 
The question was to generate a random number from 10 to 99, inclusive. I know enough to write the co...
[2 replies] Last: I think you should change this cout << (rand() % 98 + 1) to co... (by digozido)
Breadth first search and depth first search examples
 
Can someone post a code for each traversals using strings? I need to get some ideas where to start....
[no replies]
MonteCarlo Integral Program bad results
 
First shot at coding MCI. I can't figure out how to generate random floating point integers which wo...
[7 replies] Last: Ahh, how could I miss that!? I had it in my pseudocode too. Thanks for... (by jgialis)
abstract class error
 
Hey guys, so a pretty beginner exercise but I decided to give it a shot, it's from a book I am curr...
[2 replies] Last: *edit again, spotted the bug I subtracted 10 instead of 0.10 now fixed... (by adam2016)
November 2019 Pages: 1... 34567... 17
  Archived months: [oct2019] [dec2019]

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