Beginners - January 2022

by Mr Z
Class prototype and definition
 
Two-part question. Both of these seem to work and I prefer the last one, can either be used in professional programs? virtual void DoubleValue() const; ...
[17 replies] Last: I don't know Rust, but if it compiles to native machine code, then it ... (by Ganado)
The Trie data structure
 
I'm trying to digest the code from this site: https://www.techiedelight.com/cpp-implementation-trie-data-structure/ I'm currently stuck near the beginning: ...
[4 replies] Last: in the page's view source: datePublished":"2016-12-03T04:24:19+00:00" ... (by jonnin)
HELP - Menu won't function
 
I have a project for c++ and I am having a hard time getting the menu to work. I have tried so many things and I just can't get it! I would really appreciate a...
[2 replies] Last: The variables can be defined within block in which they are used. Also... (by seeplus)
How to Implement Rule
 
I have this project where we have to take a rule off of this website https://uic.edu/apps/strong-password/ and calculate the number of points for each Column an...
[18 replies] Last: For VS2022: #include <iostream> #include <cctype> #include <string>... (by seeplus)
Get Only Function
 
I have this project where we have to take a rule off of this website https://uic.edu/apps/strong-password/ and calculate the number of points for each Column an...
[1 reply] : [re-asked from http://www.cplusplus.com/forum/beginner/281986/ ] (by seeplus)
by janac
iterators, last vs end
 
When I run the code below, I get this error: Expression: cannot dereference end map/set iterator I'm confused about the meaning of last versus end, or d...
[4 replies] Last: Lets see: https://en.cppreference.com/w/cpp/algorithm/find template<... (by keskiverto)
Implementation of Threads
 
There is a program that I am doing on a Parking system in which, I want to implement a background thread that reads data from a file and gives a real-time outpu...
[9 replies] Last: hello, you can take a look at this example: https://mockstacks.com/... (by drdavid9)
Unable to play sound asynchronously in webcam opencv c++ (LINUX)
 
Im trying to play a sound in C++ opencv webcam. What I have tried : Webcam in opencv,C++. It play a wav file but since ive added "&" , therefore it keeps pla...
[1 reply] : https://www.cplusplus.com/reference/future/future/valid/ int play (... (by salem c)
better way to print out returned vector?
 
My fundamentals are still shaky and i need advice on better/simpler ways to print out the results. with reference to code below twoSum returns v, which is ...
[4 replies] Last: the compiler hinted that i can use a range-for-loop, which i would re... (by George P)
Overloading << Operator
 
I'm studying how to overload the << Operator, as template function at global scope, so I can print elements of the vector by iterating one by one. it's one o...
[3 replies] Last: thanks, lastchance (by memepapa)
Overloading () operator
 
I am pretty sure this is a beginner question. However, all my google searches failed me. So, here I am. To begin, let's say, I have a few function like, t...
[15 replies] Last: @JLBorges, Thank you very much. This is good enough. (by Rakib771)
by john98
function does not return the value
 
i just started coding in c++. i wrote a function to approximate pi value in monte carlo method but it does not return the value. #define _USE_MATH_DEFINES ...
[10 replies] Last: thank you so much guys for the help. appreciate it. (by john98)
First Project, Output calculation is very wrong
 
hello I've decided to start coding my first project and I've chosen a currency converter. It seems to be working in regards to no errors, but somewhere along...
[2 replies] Last: Variables in programming are not like variables in mathematics. Calcul... (by Ganado)
by emcp
unsure how to reference my new Factory properly
 
Hi , I am trying to leverage a project which implements connection pooling.. and customizing it for a custom connection type source https://github.com/malikkir...
[4 replies] Last: Just saw this. Glad you have a workaround. I wish I knew how to get t... (by Ganado)
I Have No Clue What I'm Doing
 
Fair Warning, this question is a beginner crap fest. My code is completely nonfunctional due to my general lack of knowledge. Please just skip if this seems...
[9 replies] Last: I should read up on how include works. https://www.learncpp.com/cpp-... (by George P)
by guack
's_size' is not a type
 
#include <SFML/Graphics.hpp> #include <SFML/System.hpp> #include <SFML/Window.hpp> #include <iostream> class Snake{ int length = 1; fl...
[15 replies] Last: @seeplus @coder777 now it is happening with snek_head.setFillColor(sf:... (by guack)
by pixi
Protecting files on a CD
 
I am new to C++. I have created a ppt application that uses mp3 sound files and jpg images. Can I use C++ to create something like a container on a CD that wo...
[2 replies] Last: Search for copy cd protection on the internet. There's a couple of way... (by seeplus)
Calculator problem
 
Write your question here. Why isn't my code going through any other of the if else, it only does if then cuts 0ff and gives me the answer for that [int main(...
[3 replies] Last: PLEASE learn to use code tags, they make reading and commenting on so... (by George P)
Not compiling properly using G++
 
I was trying to compile this using my mac terminal g++ -std=c++20 Recursion.cpp and i'm getting the following error Undefined symbols for architectur...
[16 replies] Last: I compiled and ran @OP's program using terminal on my macbook without ... (by againtry)
Advice for reading and writing files
 
I am wondering if it is possible to read in values from a previous text file that has a string (one word) and an integer(example: Lima 77) on each line, and the...
[5 replies] Last: Some pedantic-ness: I always write floating point literals with digit... (by TheIdeasMan)
January 2022 Pages: 123... 6
  Archived months: [dec2021] [feb2022]

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