Beginners - April 2021 (Page 5)

Help with homework, professor won't respond..
 
Help... I've reached out to the professor multiple times, I've reached out to my classmates, I've reached out to classmates in other classes and nobody will gi...
[10 replies] Last: Thank you everyone for your words of wisdom and input (by closed account LvfERXSz)
Dividing numbers to Decimal
 
How do I make this code spit out decimals? I can't figure out what I have to change exactly, please help. #include <iostream> #include <cstdlib> #include <...
[2 replies] Last: Hello Yeezy6Sosa, PLEASE ALWAYS USE CODE TAGS (the <> formatting bu... (by Handy Andy)
How to get input in custom function
 
I have made a custom function in a header file to get input but I can't figure out how to actually assign to it to the variable as it is returning as garbage va...
[3 replies] Last: There is no reason why functions can't go in a header file. Mark them ... (by seeplus)
List
 
"Make a function, which print on the screen, the elements with maximum key value of a List with start pointer START." What does it mean? I have a example but i ...
[3 replies] Last: Hello kerem59, I did find "<process.h>", but this is a C header file ... (by Handy Andy)
Detecting Cycle using DFS on specific nodes in graph
 
Hello guys, I am trying to use DFS to see if there is a cycle detected in the graph. I want to input selected nodes and check if the selected nodes form a cycle...
[1 reply] : At the moment you aren't distinguishing nodes that are in "lucky" from... (by lastchance)
I/O opertaions binary
 
its a code which outputs data into a file in binary than reads from it. first time it works fine, but on second run there is some run time error. basically on...
[1 reply] : You cannot write a struct containing complex objects like std::string ... (by coder777)
DFS to detect cycle with selected nodes
 
Hello guys, I am trying to detect a cycle in a graph using DFS, but the only twist is that I have to input certain nodes from the graph, and from those nodes I...
[4 replies] Last: Your question is still unclear. You have two loop structures in DFS_De... (by lastchance)
Printing Binary Search Tree To File
 
I am not sure if I am doing this right. I need to traverse through the BST recursively and not sure why it is creating an empty file? void BinarySearchTre...
[1 reply] : You're not passing the opened file to the helper, just the original fi... (by salem c)
does the new operator always malloc (in the heap) or can it something alloca (in the stack)
 
Assume we have a context { some_class some_object = new ... variable = some_object.do_stuff()//variable exists outside the context } assuming...
[2 replies] Last: assuming that some_class is trivial enough, would the new operator ca... (by dhayden)
Compile issue with Visual Studio and Searching and Sorting HW
 
Hello My complier is Visual Studio 2019, and this was the homework task. Probably did something wrong in it as well. Each "Task" is annotated by me with a "...
[9 replies] Last: Hello nickmcp11, Read carefully: duration<double, std::milli> ms_do... (by Handy Andy)
Simpler way to time an action in a loop?
 
Hello, One way to time code is to make the following if-statement, shown in the code-snippet: If(currentTime - previousTime > intervall) { // do something...
[4 replies] Last: #include <chrono> #include <iostream> using namespace std; clock_t ... (by againtry)
Searching Vectors of strings for user input values (1,2)
 
Hi all, very new beginner to C++ here. I'm writing a simple program that reads a .txt file of an english dictionary, and allows the user to search for words an...
[22 replies] Last: This was from an assignment for a unit I don't know how this assig... (by seeplus)
by abuh
Please help me
 
Write your question here. Extend the class Linkedlist by overloading the insertion operator (<<) to display the elements of a linked list. For example: Supp...
[6 replies] Last: You can move the test for a comma outside the loop if you print the co... (by dhayden)
by chipp
hex converter
 
i wanna ask, here's a simple test hex converter i wrote... why my code only returned "wrong input!" ? int hex_conv(std::string base) { double asc = 0.00; ...
[15 replies] Last: [quote=seeplus]I hope you mean number '0'.... yes... character '0' ik... (by chipp)
C machine problem
 
does anyone know how to do this layout in C? the inputs are account no, depositors name and account balance.... while the interest would be 10% from the account...
[7 replies] Last: Hello justinejerome, I wroth this little program. Give it a run and s... (by Handy Andy)
Converting integer into linked list 321 to 3->2->1
 
How can I take a string convert into integer and make the integer into a linked liked 3->2->1 #include <iostream> using namespace std; struct Node{ in...
[3 replies] Last: void Integer::generate(string s) { for ( char c : s ) tail = ( he... (by lastchance)
Switch structure
 
Am new to Cplusplus and I am learning about the switch structure. I coded a program which compares the fine that a library takes in response to the number of da...
[4 replies] Last: Some compilers report a warning on fall-through. Since c++17 the attri... (by seeplus)
error: redefinition of ‘template<class auto:8>
 
I am trying to compile a working software available over github and built successfully for many users, here is the code in header file: auto vx(auto ...
[2 replies] Last: Thanks, the compiler update worked... Followed the procedure in the l... (by boonflies)
How can i collect those queue's in a short form.
 
Hi. I have a switch case How can i collect those queue's in a short form. My code seems very complicated switch (pars.id.c ) ...
[2 replies] Last: Thank you so much for your answer (by suslucoder)
by Ch1156
How would I go about writing a program that counts down in the background?
 
So I want to make a little game using the chrono library so i can familiarize myself with it more. What I want to do is make a game where the player can craft i...
[1 reply] : you don't need a count-down for that (you can, but its overkill). you... (by jonnin)
April 2021 Pages: 1... 34567... 12
  Archived months: [mar2021] [may2021]

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