Beginners - July 2020 (Page 4)

for loop termination
 
Hello, I am currently going over a conversion of a string to upper/lower case using a for loop. The book states that "the loop iterates until the null terminati...
[3 replies] Last: OK I think I am understanding now, going to try out a few other loops ... (by DonnaPin)
by F95
VS throws stack overflow exception when array/vector is too large
 
My issue is that I get an exception thrown when my array size becomes too big: "Unhandled exception at 0x005B3BC7 in throw away.exe: 0xC00000FD: Stack overflow ...
[8 replies] Last: > If you add a parameter to your quickSort function for testing > You ... (by ne555)
make it more efficient
 
guys can someone make my code more efficient like to make it run faster ? specially the main , i know the user is going to enter 4 num and den but what if the ...
[13 replies] Last: good catch. maybe, an alternate? imp = true; ... imp &= (bool)d ; //n... (by jonnin)
Broken Triangle when printed out
 
So I am supposed to create a triangle with the base the size of what the user enters. For example if the user enters 5: * ** *** **** ***** **** *** ...
[11 replies] Last: #include <iostream> using namespace std; void triangle(int height);... (by againtry)
Why have I got a memory exception from making calls to constructors in from my class?
 
Hello I have the task of developing a class for students at university. I call the constructor of the object, creating it with some assigned values. Then I ...
[6 replies] Last: //Copy Constructor Student::Student(const Student& otherStudent) { S... (by keskiverto)
Need to Create Macro Named “CountBitsM” which provides number of bits
 
CountBitsM syntax: This macro has one parameter and produces a value of type int. There is no prototype (since macros are never prototyped). Parameters: object...
[8 replies] Last: A macro is nothing more than a "copy-and-replace" program that you wou... (by TheToaster)
print statements and doubles
 
EDIT: looks like the OP got his homework fixed, then did a runner. Every year (i.e. once per loop) you need to multiply the present balance by 1+i. That's i...
[3 replies] Last: Have one variable to hold the present balance. You could actually use ... (by lastchance)
i want to output the original format the emails were read in
 
this coverts all valid emails in all caps to check if its a dupe but I don't want it to output the valid emails in all caps, but instead it should be output the...
[2 replies] Last: okay thank you! have a good night! (by pnwadike99)
by totoo
copy constructor, copy function, destructor for linkedlist
 
I need help with the last four definitions please find the whole code here: https://repl.it/@totoo/GraveShabbyPattern#main.cpp
[2 replies] Last: oh wow that actually worked! I also don't even have any memory leak, s... (by totoo)
arrays and pointers
 
Hello, I am learning about arrays and pointers, and there is one part that I am stuck on and no matter how much I read, I still can not figure it out. My book s...
[8 replies] Last: Hey thank you for all the answers, I believe I am beginning to grasp t... (by DonnaPin)
by F95
Quick Sort: Getting an exception thrown
 
I was provided with some pseudo code to write a quick sort algorithm, but what I have so far is causing an exception to be thrown when I try to run the code. Th...
[4 replies] Last: Thank you, I was able to figure out the issue: #include <iostream> #... (by F95)
single dimension array
 
Help with HW, check the code below , need help with condition nr.3, which I have issues solving it out: 1. a+b-c equation will receive random values whi...
[6 replies] Last: The assignment text might have been lost in translation. But no doubt,... (by Ganado)
Impossible to have escape sequence in raw string literal?
 
I was wondering if the is a way to have an escape sequence in a string literal like \0xa or something of that sort.... R"( \0 heonddwnd)" ...
[3 replies] Last: @Ganado yes, yes it would. XD idk, just curious. @mbozzi hm. I though... (by highwayman)
reverse a doubly linked list
 
Hello, I have the following templated class and struct. I only need to define the reverseList(), and then I'm done with this homework. #define nullp...
[8 replies] Last: sure, but roughly 5% or less of posted homework problems make any kind... (by jonnin)
runtime error?
 
why would this test case cause this error terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 1...
[2 replies] Last: thank you ! (by pnwadike99)
how to set a block
 
why does it need to always return a true/false value from anything that isnt Y or N bool getYesorNo() { // char letsGo; bool getYesorNo = true; ...
[6 replies] Last: thank you guys! (by pnwadike99)
outputs the same song over and over
 
outputs the same song over and over and they outputs blank //libraries #include <cstdlib> //random number usage #include <ctime> //random number usage #incl...
[2 replies] Last: thank you! (by pnwadike99)
problem with a while loop
 
I am writing a code for a hangman game, and I have a problem with getting the computer to write a '_' for every letter in the while loop. (Line 24) #inclu...
[4 replies] Last: thanks :D (by closed account 9iz0SL3A)
Calculator
 
Hey pals, Check the code below : #include <iostream> #include <cstdlib> #include <conio.h> #include <iomanip> using namespace std; int ...
[13 replies] Last: while it may work, its better to use '9' instead of "9". "9" is a str... (by jonnin)
by F95
Why is my array not passing properly?
 
I need to write a function that checks if an array passed through it in order from smallest value to largest. The issue that I'm having is that the function is ...
[7 replies] Last: Thank you (by F95)
July 2020 Pages: 123456... 12
  Archived months: [jun2020] [aug2020]

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