Beginners - June 2021 (Page 5)

Confusion about variables
 
I'm doing something wrong. This is my teacher comment, what areas do I need to change? "You are printing literals 350, 159, 'A' and 'B' instead of the variable...
[3 replies] Last: I'm so dumb, I see now. Thank you so much! (by BlueCOCO1)
Tools required to build a music player
 
Hi, I am a relative beginner in c++. I've covered my c++ fundamentals (loops,conditionals,STL,etc) and now I would like to build a music player to put my knowl...
[2 replies] Last: A bit of research shows that playing mp3s is very cumbersome, and requ... (by devaatcpp)
Won't let me enter values
 
I know I did something wrong because I'm unable to enter values for the three questions to do the calculation. This is what I have so far. What am I doing wrong...
[4 replies] Last: I figured it out, I had to change the int to double since I had decima... (by BlueCOCO1)
Running Into Wall With Roman Numeral Calculator
 
Hello, can anybody help me conceptualize how to best move forward with this problem? I have a linked text file with lines like this MCCXXVI CV + I nee...
[3 replies] Last: string rn{}; cin >> rn; for(int i = 0; i < rn.length(); i++) { tota... (by jonnin)
Terminal g++ Compiler
 
Hi Can I have a question here?? I am a college student who is majoring in Computer Science. My coding class professor seems to use MacBook and always compile t...
[3 replies] Last: you can get a unix like command prompt using a program called cygwin. ... (by jonnin)
by sarvcr
First getline getting ignored
 
Hi! I'm coding an small program where I need the user to send strings, so I'm using the geline(cin,x) function. Now, I need the user to send as many strings ...
[3 replies] Last: Hello sarvcr, getline(cin, frase); //<---- This line gets ignored . ... (by Handy Andy)
Usage of macros inside class header files
 
Hi, I was wondering if it is a good practice to have #define macros in a class .h file. For example, I would have a class that manages user buttons. The class c...
[3 replies] Last: Ok thank you! for now I will go with different implementations, it se... (by jcsb1994)
Ini Files using Visual studio C++ 2008
 
Hi guys Can you help please, I want to be able to read and write to a IniFile using Visual studio C++ 2008 or C++ 2010 but I can't see or find away to do it...
[4 replies] Last: Thanks You guys for your help. (by closed account Shp21hU5)
by sarvcr
Divide Strings into Char
 
Hi! For an assignment, I have to write a code that has several functions. One of them is counting the amount of x letters in the string. Example: string phrase...
[5 replies] Last: char &c is a reference to each letter in turn. if you leave the & off... (by jonnin)
Problem with calling function from header file
 
I have a problem. I am trying to call a function that I have a prototype for in a header file and an initialization for in a .cpp file. The main function in my ...
[2 replies] Last: Thank you AbstractionAnon. (by BroBuilder)
Square made of *'s with a number inside
 
Ask the user for a single digit number. Store as int. Print a rectangle made of *'s with the number inside Im only allowed to use cin, cout and variables Th...
[5 replies] Last: Thank you so much! (by Notanormie)
Trying to read the file and tokenize each string to produce a bar chart
 
I have this .txt file. I want to extract each element that is separated by a space. For example, in line one I want to be able to extract "41" "63" as separate ...
[2 replies] Last: Do you mean like this: #include <fstream> #include <string> #includ... (by seeplus)
Palindrome Stack and Queue
 
The idea of this assignment is to use both a stack and a queue to implement a palindrome-recognition. I have finished this code. However, I wanted to get feedba...
[5 replies] Last: Re lastchance's second point. The while test in L77 could be: while... (by seeplus)
Bar chart help, no errors, won't run
 
Hey guys, me again. So I have to build a program where I have 4 cities, and the user inputs the population for them. Then my output has to produce a bar chart l...
[4 replies] Last: #include <iostream> #include <iomanip> #include <string> using namesp... (by lastchance)
varable in if statement
 
What am i doing wrong? I cannot get the discount_percent variable to apply inside of each if statement. it either says 0 or 100 when it is compiled #includ...
[3 replies] Last: This can be simplified by moving the output code to after the discount... (by seeplus)
by L67GS
Advice
 
I'm pretty green yet(just over a year), and not certain what direction to go with my studies. Being an electronics enthusiast for decades I've done quite a bit ...
[4 replies] Last: I'm thinking microcontrollers, like PIC and AVR. So having spent the l... (by L67GS)
Need Looping Help Please
 
How can I do incorporate this in the current code I already wrote: If the user enters a negative number or a non-digit number, throw and handle an appropriate e...
[5 replies] Last: std::ios_base::badbit is set in the stream's exception mask to indic... (by mbozzi)
While cicle and array
 
Hi guys, this program asks to input numbers between 0 and 5 and print the time a number occurred; and it works. BUT: I cannot understand why, if I inizialize n=...
[9 replies] Last: thanks guys, I really appreciate it! (by Zhylian)
while cicle
 
Hi everyone, here a program to evaluate the weighted average of a given set of marks and cretits. I would really appreciate a feedback on this, I want to unders...
[9 replies] Last: <3 (by Zhylian)
Palindrome method help
 
I'm writing a program to see if a string is a palindrome. I'm having trouble with the implementing the queue.enqueue(nextCharacter), stack.push(nextCharacter), ...
[6 replies] Last: For info, as 1 liner: bool isPalindrome(const std::string& str) { ... (by seeplus)
June 2021 Pages: 1... 34567... 9
  Archived months: [may2021] [jul2021]

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