Beginners - February 2020 (Page 3)

create sized dynamic array of class private members
 
For my project I'm working on, I have to create a dynamic character array to model my categories like name and title that are private in their class. The arrays...
[4 replies] Last: I have and my code didn't look like this in the submission section. Al... (by theleonicking)
Help with looping a set of code
 
Hello, this is a code snippet of something that I need help with. So, essentially, I need to loop each one of these if statements n times. The user inputs which...
[8 replies] Last: I got it! Thanks so much, Andy! Your code is working perfectly and I'm... (by theforgottenone4)
by YodaD
Output char into square
 
Write your question here. I am trying to output a square that is the same height and length as the users input Num1. But I want the square to be made of a symbo...
[4 replies] Last: Thanks so much @againtry (by YodaD)
Functions being ignored
 
-Preview option showed up blank- I'm new to c++. I learned tutorials from learncpp and was practicing everything I learned from couple chapters. IDE i'm using ...
[2 replies] Last: Thanks a lot man. I was thinking over it for a while. Didn't know what... (by Thatguy101)
Confusion with if/else statements
 
Hello. I am having an issue with my code that I cannot figure out. I have entered an equation and depending on what the result of the equation is, depends on th...
[2 replies] Last: Yes, that looks much cleaner and easier on the eye. Thank you very muc... (by SeanJohn22)
by alexas
Rotate a 3D rectangle in z axis in C++ when rectangle is described with arrays
 
I am learning C++. I need a simple example of how rotation can be done (probably using rotation matrix) in C++ language for the 3D rectangle when it is describe...
[10 replies] Last: Thank you , now I have better understanding - thanks again! (by alexas)
member function "Quest::PlayQuest" may not be redeclared outside its class
 
Thanks for any guidance, Terribly sorry in advance if things look messy or bulky. I'm trying to invoke a function declared in a separate header file/ defined...
[1 reply] : Hello topman20000, The comments in the code should explain everything... (by Handy Andy)
Compiler allowing allocation of memory to a garbage pointer index
 
This is a program of jagged array. #include<iostream> using namespace std; void display(int **Ptr, int row, int *p); int main() { int r = 0, c = 0; ...
[2 replies] Last: To me, the root cause of your error is confusion about user-friendly i... (by dhayden)
Program crashes when trying to initiate a thread in while loop
 
I want to create a new thread inside a while loop but it makes the program instantly crash on start. Any ideas on how to fix this? #include <thread> us...
[3 replies] Last: Sorry i forgot to mention i already thought it mightve been because of... (by lacked2)
Range Based For - Out of Range Error
 
OK, I'm working my way through a Udemy course. The instructor has just covered range based for loops a couple videos back. This is the exercise I am working on ...
[2 replies] Last: Thank you, againtry. That did it. (by killingthemonkey)
Converting String to Char
 
Hello, the code below works but if I remove the " // " to make it no longer a comment and replace the "hello" in the third line with a, it gives me an error. e...
[9 replies] Last: > Note: to get a pointer which can be used to modify the characters (b... (by ne555)
Bit shifting question
 
Hey guys I'm reading a book on algorithms and the author illustrates a simple hash function this hash function takes a long integer and converts it to a hashc...
[5 replies] Last: Exactly! :O) (by Duthomhas)
Fastest algorithm to conditional search within two large text files
 
Hi experts, I want to compare the contents within two large text files: i.e. In file A (n lines): x11 y11 x21 y21 C1 x12 y12 x22 y22 C2 . ....
[10 replies] Last: and, you may be able to cut the binary search down to a O(1) lookup if... (by jonnin)
by momof4
how to get a random negative number?
 
I'm working on a game, the screen goes from -200 to 200, and I need stuff to appear anywhere on it. It always just appears in the positive side. How do I get it...
[5 replies] Last: I can't even look at it now, really bad headache today. its supposed ... (by jonnin)
by F95
C++ Word search in randomly created list
 
Need to create a program that creates a Library that is 1024 lines deep and a Recent_List that is 128 lines deep. The contents of each line for both lists will ...
[7 replies] Last: It looks correct, but I still have to ask if you're doing the right th... (by dhayden)
by Bopaki
Why is it that I get a stray error \302 on every line of code
 
Each time I copy code from the internet I get these errors // C++ Program to find smallest and largest // elements in singly linked list. #include<ios...
[7 replies] Last: Thank you to all!!! I basically had to re-type the whole program befor... (by Bopaki)
Can anyone help me finding the Time Complexity of these two algorithms?
 
Here are the two algorithms, sum = 0; for( i=1; i<n; i++ ) for( j=0; j<i*n; j++ ) for( k=0; k<j; k++) sum++; and second one is...
[3 replies] Last: Got it. Thanks a lot! Really appreciate the help :) (by sindhu05)
How can I initialize this array at compile time in the constructor?
 
Here is a simplified version of the code I am having an issue with: constexpr NUMLABS = 8; //Should be able to be changed class Labs { public: La...
[13 replies] Last: Seems like an array of some union-like class type (e.g. std::optional... (by mbozzi)
access variable by pressing address
 
Hello , I wanna use Instance w to access _x by pressing address (OlMain->vref->_x=10;) through ui_MainWidow::setupUI function, but when i compile this program t...
[2 replies] Last: @coder777 thank you so much, (by nchithangvic)
File Filter Assignment
 
I need help with this assignment. I know pure basics cin, cout, type stuff. I don't know this advanced stuff. A file filter reads an input file, transforms i...
[8 replies] Last: Thank you Jonnin and Manga for you assistance (by cblack618)
February 2020 Pages: 12345... 13
  Archived months: [jan2020] [mar2020]

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