Beginners - April 2020 (Page 6)

'sin': redefinition; different exception specifications
 
Hello all, I am doing a slightly flexible calculator, I want to add the sin and cosine functions. Although I am certain the sin function works, I get the error ...
[9 replies] Last: There is no return statement at the end of the divide function. Your ... (by deleted account xyzzy)
by hbcpp
C++ GUI
 
I plan to begin learning C++ GUI programming soon and I have decide to learn both wxWidgets and QT. I just don't know yet which one should I learn first, I a...
[3 replies] Last: It's common in Qt (when using QObjects) to create an object on the hea... (by Repeater)
Decimal-and-fraction problem
 
Hello, I've been struggling with this problem for a few days. Hope you guys can help me out. Problem: A pendulum is swinging. Assume in the 1st time it swings...
[4 replies] Last: Thanks for your help. Now that I've solved it, I'm closing this now (by vucuong2005)
Need help reducing negative fraction, also using istream (1,2)
 
My problem consists of attempting to reduce a mixed fraction and not reducing the positive mixed fraction to match the output of my assignment *Will provide tha...
[20 replies] Last: The bool convertMe is used for another function I am looking to implem... (by Depressed)
by cppfr
Problem with click on loop
 
Hello, so i am beginning with c++ and i make an "autoclick" but when i leftclick the first click is going so fast like "0, 2, 3, 4, 5, ...." My friend told me ...
[1 reply] : You don't need to double post: http://www.cplusplus.com/forum/beginner... (by TheToaster)
A transform_iterator implementation
 
I came across the following code #include <memory> #include <iterator> #include <typeindex> /* Tiny transform_iterator for C++. Copyright 2018 © Joe...
[6 replies] Last: Yes, subsumed by std::views::transform_view . (by mbozzi)
What is this binary tree outputting?
 
We had a test question about what this function was outputting for the binary tree and even the smartest student in the class only got a 3/10. The test is over ...
[2 replies] Last: ah ok. I see now. It was tripping us all up. It was a timed 30 min que... (by XboxOne2019)
Vector iterator and reading in value from file
 
I am trying to create a vector iterator from the vector stl, but for the type I am using a class that holds a key value pair, like so template <typename K...
[6 replies] Last: @Enoizat Unfortunately, the txt file I had to read in from was a list ... (by Jorge626)
by cppfr
When VK_LBUTTON is not pressed
 
Hello, so i'm a beginner in c++ and i want to know how can i go this: "When VK_LBUTTON is not held, then is test = true;" "When VK_LBUTTON is not held, then ...
[1 reply] : Try: bool lbutton_down() { return bool(GetAsyncKeyState(VK_LBUT... (by dutch)
Reading from file into an array of structures
 
I am reading from a file into an array of structures but when I try to read into the second and third members (cost and number) of the structure it tells me no...
[1 reply] : There are basically two getline() functions: istream& getline (istrea... (by keskiverto)
'!' illegal operation function expression
 
Hello, I am trying to identify how many even and odd numbers I have in a text file using while loop. The code shows an error in the while loop specifically. H...
[4 replies] Last: why is using it the way you typed it wrong Do not loop on (! stream... (by AbstractionAnon)
by rytisz
Reading sentences from file with ignore()
 
i heed some help with ignore(). I have a text file with three lines of text: AMBITIONI DEDISSE SCRIPSISSE IUDICARETUR. ARAS MATTIS IUDICIUM PURUS SIT AMET F...
[4 replies] Last: #include <iostream> #include <sstream> #include <string> using namesp... (by lastchance)
How do I store a user input into an array?
 
How do I store a user input into an array? Please try to explain simply as I've only just begun learning how to code. #include <iostream> using namespace std...
[3 replies] Last: Getting user input that includes whitespace requires using getline. F... (by deleted account xyzzy)
Sorting Arrays
 
I have to make an array with 20 double digit numbers in it randomly then bubble sort them into a different array. I keep getting errors when I am trying to run...
[2 replies] Last: Hello Shawske, I keep getting errors when I am trying to run it ... (by Handy Andy)
User Defined Functions
 
string checker, that is passed a string and a character, and checks if the character is within the string. If it is, it returns an integer of the index it is a...
[6 replies] Last: thanks everone i got the idea :) (by GOdliike123)
by zajac
Closed
 
Got it working. Thanks for the help.
[3 replies] Last: You set the min from the first input. You don't set the max from the f... (by keskiverto)
c++ change console font size
 
i want change console font size, i try codes from internet but not work add latest test #include<windows.h> #include <iostream> using namespace std; ...
[9 replies] Last: I already did it https://c-for-dummies.com/blog/?p=2159 but not work (by kryganas)
Constructor
 
I wanna look at Constructor, i have reade it on Google. "In C++, whenever an object of a class is created, its constructor is called. But that's not all--its p...
[3 replies] Last: Yes. Note that T::T() : U( 42 ) {} is valid too, if it makes sense ... (by keskiverto)
by Zanza
ASCII Art with couts?
 
My teacher is getting an error with my code somehow using codeblocks on linux and he believes that it's my ascii art/graphics that are causing it. So, what I ne...
[12 replies] Last: Nah, this is getting too complicated for your professor. Tell him “... (by Duthomhas)
unable to define array size via function parameter
 
hi, im trying to define the size of an array through a const function parameter, but it returns an error void example(const int len) { std::array<int...
[5 replies] Last: thank you so much guys, I learned a lot from you (by valanche)
April 2020 Pages: 1... 45678... 20
  Archived months: [mar2020] [may2020]

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