Beginners - September 2021 (Page 5)

I'm new, and I don't know why this does not run successfully.
I am a student and starting to learn C++. Here is the question: The program accepts two positive integers from the input. Output every integer from the first nu...
[3 replies] Last: This chat is ancient, it does not support that, another post is correc... (by jonnin)
can we use lambda to initialize set/map container?
//neccessary headfiles are included int main(){ auto f= (int x,int y){return x>y;}; auto f2=&f; set<int,decltype(f2)> tree(f2); fo...
[4 replies] Last: > neccessary headfiles are included Why not paste the necessary #inclu... (by Ganado)
Sweeping/searching/slicing in c++
Hi, I would like to get a better understanding with each slicing and determine how to sweep through a user defined input, as researching the internet there's so...
[4 replies] Last: #include <iostream> #include <vector> #include <string> #include <sst... (by lastchance)
open lots of text
Working with microsoft visual studio. Wondering if there is a way to get a program to open the exact same .txt file many times and then close the program. Thank...
[9 replies] Last: Well I figured I'd have some fun and wrote it again using X11. Then wh... (by Duthomhas)
by Geckoo
What is this last address?
I have just a simple question trying to understand correctly pointers. I understand the first and the second output which work as expected, but the last one is ...
[8 replies] Last: Clever. Thanks ++ (by Geckoo)
confusion on object construction
//neccessary headfiles are included class obj{ public: int x; obj(const &o){;} obj(){}//Q1 mark1 }; int main(){ obj a;//Q1 mark2 a.x...
[1 reply] : L11 creates a as an instance of obj using default constructor - as no ... (by seeplus)
Floating point number greater than 8 bytes
Is it possible in C++ to handle number that would be greater thatn 8 bytes? I have a situation where I need to do that. I thought the solution would be to use ...
[12 replies] Last: Doh, and I fail the class for not reading the instructions! still, the... (by jonnin)
Unary Operator Overloading
Why is this compiled? (EDIT: in line no 24) Isn't c++ is rval? even if it is lval it is not assigned to 4. #include <iostream> using namespace std; class Co...
[6 replies] Last: thanks (by divBaral)
Open another window in visual studio
Trying to make a C++ code in visual studio 2019 that will open a video in another window, and create a new window, not play the video in the command thingy. A l...
[4 replies] Last: that will open a video in another window I know the basics Knowin... (by malibor)
Working on creating a class with methods, using functions i have to get and display info im getting an error that says "error: no matching function for call ...
[1 reply] : Edit: You don't have the <string> header included, the compiler would ... (by TheIdeasMan)
Extract and Add a Series of Numbers
I have to extract numbers from a string and then add them, but I am stuck and I'm just not sure what to do next if anyone could guide me to get further it would...
[10 replies] Last: I offended him in another thread. Rather than accept that Things Don'... (by Duthomhas)
Timed Password Cancel
how i delete a post
[1 reply] : little things: just return 3, exit(3) is not useful. unistd locks yo... (by jonnin)
Find Largest Prime Number
A Prime Number is a number that is greater than 1 and has just two factors: itself and 1. Given an integer, N, for N ≥ 2, a common question is, what is the...
[17 replies] Last: the trick to the babylon method is the initial guess. for 0-10k, a be... (by jonnin)
ASCII art not printing
I'm having trouble figuring out why the console is not printing out the ASCII art. Side note, there might be a few other mathematical issues as well as the fac...
[9 replies] Last: Here's your happy house.... There's something fishy goin' on here: ... (by George P)
(Pointer) can you tell me the difference in two blocks of code?
Hi I am learning c++ linked list data structure. I am stuck in understanding difference of these two blocks of code. 1.First void addAtHead(int val) { ...
[6 replies] Last: Thank you so much all for very well written explanation. It makes much... (by dntwk707)
Pointer inside the struct
use pointers inside classes or struct, can some explain why/how use pointers inside the struct, i have an example here , if someone can help, please explain it...
[8 replies] Last: The nextPointer here is used to point to next item in the linked list... (by AbstractionAnon)
by dizzie
unexpected and unwanted output
hey, I'm having problems with coding this program. the output is not what i wanted. any ideas? this is the question: The manager of the Diner by the Valley ...
[3 replies] Last: float menu, type, request, water; These variables are never set t... (by seeplus)
user defined literal, REQUIRES long double???
QUESTION 1: Why do I get a compile error invalid parameter list when I set the user defined literal a double in the parameter list, instead of a long double? Is...
[10 replies] Last: Arguably optimizing readability and code quality raises the ceiling of... (by helios)
Wireless tagging for beginners
I will preface this question with a caveat: I'm a reasonably talented programmer, but an absolute novice in electronics. This will be my first project. My dad ...
[3 replies] Last: Sounds like an opportunity for an Arduino/Raspberry Pi combined with s... (by againtry)
How to make sure that different dynamic memory is allocated to the same pointer when using while loop? (1,2)
Here is my question: How to use a while loop to allocate different dynamic memory address to the same pointer? For example, there is a pointer named "Creator"...
[38 replies] Last: you started the slang. (by anup30)
September 2021 Pages: 1... 34567
  Archived months: [aug2021] [oct2021]

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