Beginners - April 2022 (Page 3)

having problems on line 49
 
Hello I would like to get some feedback on my overall code here. And i am getting stuck on line 49. your feedback will be appreciated. #include<iostr...
[7 replies] Last: [quote=HellocMonkey]I have an error on line 49 still I don't know if ... (by George P)
button that turns off all features in embedded systems
 
Hey my name is Sophia, I am new to coding and embedded systems and I wanted to make a button that turns off and on a LED and at the same time turn off all o...
[3 replies] Last: Have you heard of integer division? In c++ and most other programming ... (by lastchance)
Boolean to define prefix
 
Hi I have a number of string variables String Day1_Log = "Logs for day 1: " String Day2_Log = "Logs for day 2: " String Day3_Log = "Logs for day 3: " And a ...
[4 replies] Last: The latest code is working and it looks for a state change First it wa... (by robduis)
Initializing constructor
 
Hey everyone, Ik keep bumping my head agains this, i have a knowledge gap on initializing contsructors, if anyone knows a good resource or could explain it wou...
[5 replies] Last: well, now i have to pass this aditional unlockform: here in the exampl... (by wimvandenborre)
Studying Advice
 
Hi I am a student at a community college. I am looking for some help in studying for a C++ exam. Its on the chapters 10 - 12 from the Starting out with C++ ...
[4 replies] Last: Have a look at https://www.learncpp.com/ (by seeplus)
how to ensure an input is an integer?
 
int age; cout << "how old are you?" << endl; cin >> age; how could i edit this to make sure the age is actually an integer?
[6 replies] Last: User input is never "simple". To do it correctly, understand that the... (by Duthomhas)
Functions
 
Write your question here. I'm really lost with this code I dont really have a clue Im not trying to cheat I just work better off a finished code. #includ...
[3 replies] Last: Also for the prototype you should have double percent(int ptsEarned, ... (by seeplus)
Hailstone sequence
 
I am having difficulties with this lab so so if anyone can help, it would be greatly appreciated. Given a positive integer n, the following rules will always c...
[4 replies] Last: Thanks for your help! I am truly grateful your both of your efforts. (by RandomnessRamen)
Trying to input a file and storing the data in a vector
 
Hello everyone! I am trying to store the data of a file into a vector of type Ingredients*. I would really appreciate it if you could help me. The project has a...
[11 replies] Last: Thank you! I really appreciate your help. I have now added the other c... (by kostomberov)
static_cast and enum value
 
Why can't I sucessfully get the enum value from the static cast? What am I missing? #include <iostream> using namespace std; struct Date{ int day...
[6 replies] Last: Perhaps something like: #include <iostream> struct Date { unsigne... (by seeplus)
vector.erase()
 
how would i erase elements from my vector without using a constant integer? my vector is sorted like: username(1),password(1),name(1),age(1),hours(1),late(1),u...
[3 replies] Last: but i do not know the value of z before i run my program. from what ... (by seeplus)
How can I transfer the user input from function to function
 
I cant seem to get the program to calculate the hypotenuse. It prints 0.00 everytime. I think it's because it has no clue about the user's input. (I'm aware ...
[5 replies] Last: thank you ^^^ (by vasncode)
by jNc
string array to dat file issues
 
Hello there, i'm having difficulties when importing string array of 18 columns to dat file. It crashes in 30% times... Why does it happen? I guess it must be ...
[7 replies] Last: Note that if Database contains pointers (or objects that contain point... (by Peter87)
Nested Class using function in outer class?
 
class A: hello() greeting() <>class B: <>hello() is there a way so that class B can access the functions in class A without having to retype the function...
[3 replies] Last: Nested classes can access all member functions (and member variables) ... (by Peter87)
Two issues my loops
 
Having two issues with this code. First, I need it to display the last 20 prime numbers. Currently it shows me the first 20 (this is probably an easy fix but I'...
[7 replies] Last: Sieve, obviously. On introduction valarray was the moon from the sky,... (by keskiverto)
cout'ing a float
 
Hey yall, another question. So I'm trying to output a float in a cout statement, and it keeps giving me extra numbers on the end, specifically 012142. The float...
[5 replies] Last: If you print a newline character '\n' right after the float do the e... (by Peter87)
by Geckoo
Function and its parameters
 
Hello everyone. I remember an article explaining how to manage functions and their parameters. However, I remember an explanation about some additional paramete...
[9 replies] Last: One of the biggest reasons why I tend to avoid using variadic argument... (by George P)
How do I return a value of -1 if there are no duplicate values
 
This code is supposed to find the value with the most occurences. It's supposed to return a -1 if the their were no duplicate values. Here is what I came up w...
[4 replies] Last: If you take 100 values ... each between 1 and 100 ... the chance of no... (by lastchance)
what is 0x3<<14 mean ?
 
I am new in c++ coding in this chapter I can not understand the meaning of " mask = 0x4<<16;"
[4 replies] Last: this is, by the way, horrible code. the function uses pointers to repl... (by jonnin)
by Pen72
Fitting items
 
Is this similar to knapsack problem, what sort of functions should I use? There are N chocolates and several boxes. Each chocolate has its own calories. Each...
[10 replies] Last: Yes, it works well now, thanks, I'll dive into the code. (by Pen72)
April 2022 Pages: 12345... 7
  Archived months: [mar2022] [may2022]

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