Beginners - July 2020 (Page 5)

hash table function (1,2)
 
I am having issues with my function below - namely EXC_BAD_ACCESS (code=1, address=0x0) when searching to check if string is present. I have an array std::s...
[26 replies] Last: Your hash function isn't very good. ABC gives the same hash as CBA and... (by dhayden)
Problem With Virtual Function & Abstract Class (1,2)
 
In a console game I've been working on where you play a fighter and kill monsters, I got everything to work, but I wanted to make it more interesting. I tried t...
[29 replies] Last: @ne555 Thank you very much. I took a closer look at smart pointers an... (by devious dm)
How do I sort my strings to print them out?
 
How do I sort my strings to print them out? #include<iostream> #include<fstream> #include<sstream> #include<string> #include<iomanip> #include <set> #...
[5 replies] Last: Hello nikovch, How do I sort my strings to print them out? First... (by Handy Andy)
by dbabo
static const char from Clib
 
Hello, I'd like to use the esp_log library ( https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/log.html) in my cpp program. But ...
[1 reply] : And the answers are: a. Someone already ran into this same situation -... (by dbabo)
Pointers - incrementing and decrementing value
 
Hello, I am learning about pointers, and currently reading about incrementing and decrementing the value that they point to. It says to do so i can use (*pointe...
[4 replies] Last: Ah ok I understand now. that is very helpful, thank you for explaining... (by DonnaPin)
this loop just wont work
 
why isn't the game loop looping error says control reaches the end of non-void function //libraries #include <cstdlib> //random number usage #include <ctime>...
[8 replies] Last: void getCard(PlayingCard *a, PlayingCard *b) { //data int d = 0; ... (by pnwadike99)
Problems with my code.
 
1)First of all, i am very new with c++. know a bit or two seriously. I have assignment due next week. 2)Why my program display address memory instead of the va...
[3 replies] Last: Thank you very much Andy , I'll try to reedit my code with what you'v... (by xxazizixx1)
Bubble sort Print result help!
 
I got this far with the code below. I am looking to print the result a certain way for testing (see below picture result desired). I have absolutely no clue wha...
[4 replies] Last: Hello studentlearningcplusplus, In post http://www.cplusplus.com/foru... (by Handy Andy)
problem
 
guys whats the problem with the bool function line 26 ? is something wrong with my friending ? ( Error (active) E0265 26 member "square::side" (declared at lin...
[2 replies] Last: ty : ) (by John3682)
by sturk
for loop statement confusion
 
What is the for loop statement below mean? Can someone break it down for me? I tried replacing it with for(size_t i = NumBits; i> 0;i--) . but it doesn't work....
[2 replies] Last: but it doesn't work Everything "works". It just does a different thi... (by keskiverto)
why is it running when the file is empty.
 
it should be saying the file is empty but it just runs the program with zeros and if I don't set the zero, it runs the program with twos. //libraries #in...
[2 replies] Last: thank you! (by pnwadike99)
by akhi
Linked List Class
 
I'm having an issue with some functionality of my C++ Code. The program is suppose to generate 5 random integers, and also delete numbers from the randomly gene...
[10 replies] Last: Thanks for everyone's help while I worked through my troubleshooting. ... (by akhi)
Bubble Sort Please help.
 
I have to sort random data with bubble sort and animation. I believe my below code is somewhat "ok"? But I would like to delay each line by asking user to press...
[4 replies] Last: Hello studentlearningcplusplus, Sorry. It took a couple of times to ... (by Handy Andy)
Help with basic syntax for == operator
 
Can you please confirm the syntax for this "==" operator is correct based on a class "class Point" as indicated below. I attempted to run a unit test like th...
[2 replies] Last: >CHECK_EQUAL(Point(1,2) Point(1,2)); I would have expected a comma the... (by ne555)
it keeps saying everything is and invalid input...why?
 
i dont understand where the logic falls apart, everything makes sense to me. //libraries #include <algorithm> // reference to transform #include <cctype...
[4 replies] Last: that makes sense, i see how && does what i want it to. thank you! (by pnwadike99)
Object inside class construction
 
I have a class Parking and a object inside named Menu. I have to populate Menu through a custom constructor such as menu1("Menu Title", int); //int is a inde...
[4 replies] Last: Please feel free to come up with your own solutions, I cant use my Men... (by noahpereira20)
help fixing my code
 
im almost done with my code, just need to fix a few things. the prompt is to calculate shipping charges of a package based on the distance it will be shipped an...
[5 replies] Last: thank you. when I try to run the code, it doesn't calculate the cost a... (by amps1204)
Help with my code
 
I am writing a program that outputs an election and the votes that each person gets. The candidates are entered into the program and it outputs the candidate na...
[1 reply] : Mmm, ok, so what's actually wrong then? $ ./a.out Enter number of c... (by salem c)
Working with arrays and text files
 
Consider the following text file: ========= 25 April Brown$ 73 76 88 61 Gary McLean$ 53 57 80 76 Moses white$ 67 69 78 Gayle P. Lloyd$ 81 77 91 Beatrice George...
[3 replies] Last: Hi Andy, Thank you for taking a look at my post. I truly appreciate ... (by daybreak528)
Valgrind mismatch frees NEED HELP QUICK
 
Hello all, trying to complete a project for school due midnight and have come across two Valgrind errors, Don't mind the messy and unneccessary code, it's f...
[2 replies] Last: Line 2 says new char but line 42 says delete . Since m_title is... (by mbozzi)
July 2020 Pages: 1... 34567... 12
  Archived months: [jun2020] [aug2020]

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