Beginners - January 2021

c++ find duplicate strings in vector and print all occurrence of them
 
So i'm looking for a soultion to print duplicate strings in a vector. If the vector contains {a,b,c,...
[12 replies] Last: Based on this statement: Loop over the given array of strings to buil... (by lastchance)
Question regarding primes in array
 
Hello all, I am trying to spot all the prime numbers within an array however my code, apart from ...
[6 replies] Last: if you are checking for small values (I see a %10 in there!) you can g... (by jonnin)
about dynamic_cast
 
When I delete the body content of Class B, errors occur on compilation. I tried to replace "virtual...
[5 replies] Last: > I see a pointer pointing to a base class can also be used to point t... (by ne555)
by telco
Writing a matrix in text file
 
I am trying to create a new text file and write a matrix value in it using fstream. But i am gettin...
[11 replies] Last: We are (a library is) allowed to create proxy objects and use expressi... (by JLBorges)
Compiling and running your program
 
I have no idea what I’m doing honestly. Coming from Java, VS code 2019 is new to me. I’ve tried ...
[6 replies] Last: all IDE make a bunch of 'intermediate' files, not just an exe. All co... (by jonnin)
Copy pointer to pointer in function - C (1,2)
 
Hello, I'd like to copy pointer to pointer in function and I don't want to use the library. But i...
[22 replies] Last: > in that regard, > int insert(char*& str1, char* str2, size_t n) > ... (by JLBorges)
Only accepting 4 inputs from user
 
Hello guys. I am a beginner in c++. I am trying a coding where user can only enter 4 characters for ...
[3 replies] Last: Hello Mathavan, Consider this for you function: int add_movie() //... (by Handy Andy)
Trouble converting while loops to for and do loop
 
Hi 2 everyone, I have been working on this for some time now and have been stuck in the same spot. I...
[3 replies] Last: @cpluspython - please don't edit the original post so that future answ... (by seeplus)
by Feit
How to convert string to long int
 
Hi everyone, I need to declare a vector using string and then convert it to long int. I wrote the f...
[6 replies] Last: @seeplus and @salem, many thanks. Very helpful answers (by Feit)
Read a whole sentence till i find a specific word
 
hi, i wanne read a sentence that is no more than 100 symbols and when it reads the word stop it ...
[4 replies] Last: Consider: #include <iostream> #include <iomanip> #include <cstring> ... (by seeplus)
Conditional wait and signal in multi-threading
 
Hye! I saw this code on geeks for geeks. But I am not able to fully get it. // C program to...
[2 replies] Last: t1: created and starts running foo main: sleeps for 1 second to ensure... (by lost110)
by Ch1156
Correct use of this pointer (1,2)
 
I was following along with a youtube video on how to do some OOP stuff like inheritance and all that...
[31 replies] Last: Excellent. Another aspect to throw into the melting pot is UML and cla... (by againtry)
Cicle Class Project
 
Hello, I am hoping someone can tell me why I am getting this error in my code. Code is for an assi...
[3 replies] Last: Doing console input correctly when you want to flag non-numeric and ce... (by deleted account xyzzy)
by kmce
Class inheritance problem
 
I am creating a small program to practice inheritance etc and I am having a issue that I can not fig...
[2 replies] Last: Oh of course, that was stupid of me. thank you (by kmce)
Won't do the right thing.
 
Please look through my code. Its to long to post here: https://ashtonfroude.wixsite.com/mysite-3/pos...
[11 replies] Last: If you're going to link code externally, please just use something sim... (by Ganado)
Varied Amount of input data
 
Currently working on a lab that requires me to make a program that takes any number of non-negative ...
[4 replies] Last: max = input worked, thank you! (by StaveDrider)
Confusing question regarding semaphores and threads
 
I am not able to understand this dependency diagram because there are no arrows in it! Whether threa...
[1 reply] : I'd say the first place to start is here https://docs.microsoft.com/en... (by markyrocks)
There is a problem reading the file.
 
I completely enter the file address for the code test. But ''else'' is constantly executed. What cou...
[6 replies] Last: Oh right, cin >> char_array would add the null terminator already. Tha... (by Ganado)
by abrock
Documentation of std::nth_element
 
Hi, I'm using std::nth_element on vectors, some of them are pre-sorted and some are not. I found ...
[2 replies] Last: Which description from where? If for the cplusplus.com site, then pro... (by seeplus)
ofstream - unable to write onto next time line
 
Am i doing it right? I am still really noob at this. Everytime i run the code, only a line of text w...
[3 replies] Last: Open the file in append mode: ofstream projectFile("projectfile.txt... (by seeplus)
January 2021 Pages: 123... 11
  Archived months: [dec2020] [feb2021]

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