Beginners - November 2022 (Page 2)

how to get what line makes error if I run program in terminal
 
how to get what line makes error if I run program in terminal I might know where It can be generated, but It will be helpful, if can get line number for the er...
[5 replies] Last: @JLBorges - really neat solution. Adopted ++ (by Geckoo)
Please Help debug, first time serializing into file
 
Getting alot of bugs, first off, in my output its all 1's when it should be a mix of 1's and 0's, and second off litterally nothing is happening with my file, e...
[9 replies] Last: Maybe something like: #include <iostream> #include <string> #includ... (by seeplus)
MACRO question
 
Hi guys. I have question regarding macro: #define tcp_sndbuf(pcb) (TCPWND16((pcb)->snd_buf)) #define TCPWND16(x) (x) What do...
[10 replies] Last: Thanks :) (by Jonathan100)
How do I rewrite my code into classes?
 
So I recently started learning Object Oriented Programming, and my professor gave me some questions to work on my own. One of these questions involve creating a...
[10 replies] Last: In my opinion, what Herb calls the "interface principle" is really abo... (by mbozzi)
PriorityQueue enqueue and dequeue functions
 
I have a trying to create a list of patients sorted by their priority of ailments that have been added by the user. I have several header files with differen...
[5 replies] Last: You have two elements in Ailments: sev for severity and time for time... (by AbstractionAnon)
Adding data to linked list
 
I am trying to add data to a linked list. However when I go to add the data I get an error: "no suitable user-defined conversion from "std::string" to "const Ai...
[1 reply] : Line 2: You haven't shown the definition of Ailment. Presumably, it ... (by AbstractionAnon)
If statement is not being selected when condition is met
 
Hi, I am writing a console application that gives the user a list of options to choose from. Viewing the code below, when the option "0 - Exit" is selected my c...
[1 reply] : Line 17 is while (user_selection). A conditional statement will be co... (by Ganado)
Console Input with std::getline()
 
Hi, I am currently writing a program that will take in patient information that will determine the priority in queue. I am writing the console application th...
[3 replies] Last: Thank you so much! I can't believe it was as simple as just removing t... (by d3sousa92)
Cannot use constant in class array declaration (1,2)
 
Windows 11, Visual Studio 2019, C++ In the private section of a class I want an array of a specific size using a named constant. const size_t max_length ...
[20 replies] Last: Assuming that you're installing VS2022 from the official MS site, then... (by seeplus)
need help to find issue in the code urgent!!
 
Below code my TestLoop class do not work in the code. What could be wrong here? Please help me on this. #include <iostream> #include <unordered_map> #include...
[7 replies] Last: My bad, missed the header file. Realised my mistake. Thanks a lot seep... (by denver2020)
All possible combination
 
The problem is "You are given 3 types of coin, 10, 50 and 100. print all the possible combination that add up to 370". I thought this problem is going to be sim...
[4 replies] Last: @Minionmin, A couple of suggestions: 1. When using C library functio... (by deleted account xyzzy)
Why a compiler can't deduce dependent names
 
Hello, Could someone give me a dumbed down version of why a compiler can't deduce dependent names. I kind of got the impression that: 1. The compiler can't ge...
[5 replies] Last: Dependent names are names whose meaning depends on a template paramete... (by mbozzi)
how can I copy file from folder to folder with c++
 
how can I copy file from folder to folder with c++ ? might be system echo smth...
[2 replies] Last: you can indeed use system to use c++ to make a more complex 'batch fil... (by jonnin)
SFINAE test: no output
 
I wanted to test some SFINAE but got stuck on the fact that the return statement on row 19 is not printing normal. I though I was doing something wrong but when...
[2 replies] Last: Yep, just realized that. My bad. (by jaffe15)
How To Exit from loop with out resrarting app
 
I have outer while loop and inner while loop Sometimes I Need To Exit from while loop when nessesary loop conditions is not met How can I proceed?
[5 replies] Last: Input, when handled, stores data somewhere. That data can be used in c... (by keskiverto)
Fold expression not working (beginner example)
 
Hi, Wondering why this fold expression does not work (args is a parameter pack): (cout << ... << (args << std::endl)); Following binary left fold...
[3 replies] Last: Note that there is a difference between mbozzi's and my suggested code... (by Peter87)
by Geckoo
Static Library
 
Noob question - sorry for that! I created a static library (.lib) with some basical functions. Creating another project (a simple console project) I added th...
[12 replies] Last: If you hover the mouse over one it should show a warning number and a... (by Geckoo)
by Geckoo
Virtual function (1,2,3,4)
 
Hello. I have a little problem in order to understand why some functions should be virtual. I read often that a C++ virtual function is a member function in the...
[64 replies] Last: Thanks you everyone for your good explanation which are really interes... (by Geckoo)
November 2022 Pages: 12
  Archived months: [oct2022] [dec2022]

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