Beginners - July 2020 (Page 6)

Need Help with some memory leak issues
 
Hi all, I am having trouble getting rid of some memory errors, I'll provide all my files incase the problem stretches across multiple errors. So I have a mod...
[7 replies] Last: > I'll provide all my files incase the problem stretches across multip... (by ne555)
spot the problem
 
guys whats the problem with this code : int silly(int n) { if (n<=0) { return 1; } else if (n%2==0) { return n; } else { silly(n - 3); } } ...
[10 replies] Last: thank u so much guys : ) sorry i cdnt answer sooner since i didn't h... (by John3682)
enum question
 
I'm learning C++ and the enum Creation code below I don't grasp how that is being used in the code? I see Call_iIchimoku is used a few lines down in the inpu...
[5 replies] Last: I understand re using links for file attachments. Now I know. So I th... (by rfresh737)
Swapping value
 
Hi everyone. I'm new to C++. I'm seeking for some advise here. I had some problem here. Given matrix (5x15) known as route as below. For each row, I need to sel...
[2 replies] Last: This is an older post, so I hope you figured it out. Not sure if I u... (by memoria)
Rule of 3 and destructors
 
Hello, I'm working on a homework project that involves creating a predator/prey "simulation." It's very basic stuff, but it's meant to test our knowledge of mul...
[19 replies] Last: Just a quick bump to say I got a 100 on this assignment :D Thanks agai... (by memoria)
Unittesting in cpp Visual studio
 
Hi Everyone, What are the frameworks available for unit testing in c++ visual studio. Please share the related documents or links available for the same. ...
[4 replies] Last: I find that the easiest to use are catch2 and doctest - just 1 header ... (by Thomas1965)
Primary-Expression Compilation Error
 
I tried compiling this code, and the error that says that the Array parameter in the function requires something called a primary-expression. What is it and ...
[2 replies] Last: Lets see: In function 'int main()': 69:62: error: expected primary-e... (by keskiverto)
converting a repeating decimal to a fraction
 
so i was given a book exercise where we are give 3 decimal expansion values: 2.5R0 0.08R3 0.R142857 so the "R" is for repeated portion of ...
[5 replies] Last: Split your string (using stringstream and the 3-argument form of getli... (by lastchance)
Code review request for efficiency
 
Brand new coder here. This code works, but I would love some feedback on inefficiencies and/or bad habit avoidance. Thanks for taking the time! #include <...
[3 replies] Last: Lets make a table (for 7 rows): row P M 0 3 - 1 2 1 2 1 3 3 0... (by keskiverto)
"x" does not name a type
 
I'm following a tutorial to build a particle explosion project. I'm working in steps and creating a new project for each step. In order to get practice typing o...
[13 replies] Last: read this http://www.cplusplus.com/forum/articles/10627/ your problem ... (by ne555)
44 instead of 4
 
why does my program output 44 instead of 4 it is supposed to count how many @ signs are in the file and output that number. the file in question looks like th...
[3 replies] Last: I would suggest taking it easy on the comments. It makes reading the c... (by helios)
I need assistance with my assignment
 
I have an assignment and could use some help with it. I have part of it working, but not all of it. Here is my assignment. Example 10-10 defined a class perso...
[1 reply] : Your personType class contains no function called "isFirstName". There... (by Ganado)
by momof4
Why won't my constructor work?
 
I keep getting this error: no matching function for call to 'Board::Board()' :topLeft(tl), bottomRight(br) I'm not even sure what that's talking about. It ...
[1 reply] : When you have a class with no constructor defined, the compiler gives ... (by Ganado)
no outputs
 
had it working before I tried adding the sort and duplicate functions. now it just outputs a blank file and doesn't output anything to the console. any observat...
[5 replies] Last: thank you so much andy my your advice was very helpful and helped me u... (by pnwadike99)
Vectors in classes
 
How do i use vector in classes, cause when i do the following it dont work: CStart::CStart(int pSpieler){ vector <string> mPlayers(pSpieler); // like...
[16 replies] Last: Like in the above: class CStart { // ... vector<string> mPlayers;... (by keskiverto)
by momof4
how to delete an item from a list
 
I passed in a single block, and now I need to see if any of the other blocks have an identical number, and if it does, delete that block. bool numberIsSame(B...
[5 replies] Last: It won't work correctly without it. I originally said that 'it' will "... (by dutch)
by sparki
Constraints in memory footprints of bitarr
 
Hi, Sorry if I am making a few posts. But I'd really need help here as deadline is near. Anyway, I am having trouble with the additional constraints on memory f...
[10 replies] Last: that makes sense -- the design of both of those was for dealing with g... (by jonnin)
by GonlyG
need help for printing BFS node source
 
I'm testing around with BFS and I understand the basic algorithm to display the nodes in visited order, but am struggling to get the nodes used to visit that pa...
[8 replies] Last: Please post your current code and the input. (by dhayden)
by sparki
Run-Time Check Failure #2
 
Hi, Thanks everyone for the help so far and my apologies for the numerous post. This should be my last post if I'm able to get this problem resolved. I have imp...
[2 replies] Last: You are not implementing it properly at all. You've calculated how man... (by dutch)
Regex to capture both digit values in string
 
Imagine I will be reading an XML file. Like the lines used in the example below. I need to capture the value of x and y for each line. If possible, avoiding an ...
[2 replies] Last: Is this for an exercise? If not, why not use an XML parser? Andy (by andywestken)
July 2020 Pages: 1... 45678... 12
  Archived months: [jun2020] [aug2020]

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