Beginners - January 2020 (Page 3)

How can i create schedule builder
 
Hey I am new to programming and as a college project I want to build schedule maker. I don't know how to start can anyone tell me how to create a similar tool l...
[2 replies] Last: Thanks I'll try this (by hanumaaan)
Clean up code
 
Basically what the title says. What can I do to simplify this (cut it down to only the necessary parts)? I'm trying to learn how to be more efficient. Please no...
[2 replies] Last: #include <iostream> #include <ctime> #include <cstdlib> using namespa... (by lastchance)
shifting elements in an array
 
Hi everyone, I know this is a common question, but I've gone through all of the related posts that I could find, and none of it seems to solve my problem. I'm...
[9 replies] Last: #include <iostream> using namespace std; const int ARRAY_CAP = 10; ... (by lastchance)
Extract particular loop number from a loop
 
In my code, a loop is occurring 25 times, where the variable has been assigned as part. (example has been provided below) for (int part = 0; part < 75;...
[3 replies] Last: condition1 && condition2 is the same thing as "if cond1 and cond2 are ... (by highwayman)
by vysero
Include's
 
This is just a general "best practices" question. Let's say header file X has an include Y but header file X also has an include Z which is including Y. Is it b...
[2 replies] Last: Oh yes, of course, that makes sense thank you. (by vysero)
passing a function a non decided amount of arguments/parameters
 
Hi there, I am wanting to have a function that i call from main that i want to pass a certain amount of arguments that i can change the amount of, ie- the first...
[5 replies] Last: @jonin we must have replied at the same time... lol this isn't weird!... (by markyrocks)
How to write destructor ( unique_ptr<T>).
 
I am working on a custom container class. My main method runs correctly. Iterating the contents and printing via cout. Once complete it then throws a runtime er...
[7 replies] Last: UPDATE : The original error - HEAP CORRUPTION DETECTED: before Nor... (by goozeberry)
Help with a Loop
 
Hello, I'm currently making a program that reads off a file and prints a list of movies playing within a certain date range. However, I am struggling to figure ...
[4 replies] Last: Hi, I've implemented what you've suggested and I see what you mean no... (by Beararms)
Erase vector items exercise
 
Hi everyone. I am a student learning C++. I have a the following assignment that I can't get to compile. Does anyone offer any hints as to why? This is not for ...
[5 replies] Last: lucretia borgese reports again from the nunnery fatuaosa (by againtry)
Function not returning bool value
 
Given a list of numbers and a number k, return whether any two numbers from the list add up to k. For example, given [10, 15, 3, 7] and k of 17, return tru...
[3 replies] Last: Thank you so much guys! (by Vijay0753)
Add element to Custom STL Container Class
 
I am building a RingBuffer Container and I struggling with how I should be using pointers to interact with the underlying array and complete the necessary metho...
[6 replies] Last: ¿how do you distinguish between a full buffer and an empty buffer? ... (by ne555)
Typeid
 
Ok, so if I remember correctly, typeid returns some sort of char or maybe it’s a string. For now I’ll just assume that’s correct. If a make a new 'type' w...
[2 replies] Last: That actually cleared up a lot of stuff lol. Thanks for putting up wi... (by highwayman)
Ternary expression issue?
 
Hi. I'm playing around with some simple tutorials that i found online. just so i can get a better understanding of how stuff works. I'm kinda combining 2 tuto...
[5 replies] Last: If you format ?: like this std::string sloglevel = log_level >= 2?... (by mbozzi)
by hbcpp
Finding the largest element in a vector / array vs vector
 
I have a school assignment, even though the class teaches C, my teacher said it is ok for me to use C++ since I have been programming in C++ for a while now. ...
[11 replies] Last: #include <iostream> #include <iomanip> #include <string> #include <al... (by lastchance)
int to string
 
Hello, so p=11 which is an int. I convert it to a string and I do the following for loop to display the strings content it will output, 1 1 if (p != 0)...
[16 replies] Last: > superiority complex much? I apologize if what I said was in any way... (by highwayman)
normalization of database
 
Hi everyone. Can anyone explain to me what is meant by 'normalize the database' and what benefit is associated with normalization in databases. Also does it aff...
[3 replies] Last: Obviously you are supposed to research this yourself. You are literall... (by dutch)
by ema897
AdjMatrix
 
I'm trying to implement adj matrix, not knowing dimension. Target is to clear a flag using method clearVisited() of my class Component void Circuit :: ...
[9 replies] Last: Can you show the full code and the full problem description if this is... (by dhayden)
I need help in my C++ class.
 
I am in currently enrolled in a C++ course and haven't taken coding in 5 years. My professor glazes over topic and just assign this question: Please write a...
[1 reply] : #include <iostream> int main() { int x = 0 ; // The variable x s... (by JLBorges)
Special member function as a template?
 
I am currently reading a book (C++ Templates: The Complete Guide 2e) that explains that a member function template will never replace the special member functio...
[3 replies] Last: I don't see why converting to volatile enables "better matches" Perh... (by Enoizat)
by newGrl
help! multiple files and "undefined reference to"
 
Hi everyone, This is a school project. I haven't even started and I'm stuck. There two .cpp files and a header file that were provided by the teacher. I h...
[5 replies] Last: Thank you everyone for the replies!! dutch, you were exactly right abo... (by newGrl)
January 2020 Pages: 12345... 12
  Archived months: [dec2019] [feb2020]

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