Beginners - April 2019 (Page 14)

User Defined Functions Help
 
Hello! I am new to user-defined functions and I am trying to get them to work. Whenever I introduce a variable in the function that is identified in main, it ...
[6 replies] Last: That appears to have fixed it, Thank you! (by thylath)
LNK2019 error - PPP chapter 16 Drill
 
I'm going through Bjarne Stroustrup's Programming Principles and practice and have reached chapter 16, which is the introduction of callbacks. The Drill at the...
[4 replies] Last: C16_main.cpp:1:9: fatal error: ../../lib_files/Lines_window_2.h: No s... (by grumblesnake)
by darkX
Maximising the remainder
 
Given a set of numbers that may be added any number of times to produce to produce a number. the only condition or rather motive is to maximise the remainder wh...
[11 replies] Last: How about Goldbach's conjecture in this context? Well, we dno't have a... (by MikeStgt)
Calling a function in a function without parameters ?
 
Hey, in line 24th void print I don't want to use p and int parameters because I'm not using them for printing only the value that I got from line 18th function....
[1 reply] : It's usually a good idea to separate computation from presentation. In... (by dhayden)
play music with c++
 
Hi, I'm a beginner in C + +. How to implement the following code start playing music in 2 seconds? It would be better if you could give me a simple example s...
[1 reply] : Use sleep_for(). See the example here: http://www.cplusplus.com/refer... (by dhayden)
by Horror
Problem with Function Program
 
What this program is supposed to do is have the user to enter values for a, b, c, d, and e. Then to find the largest of the five and print them. The program see...
[6 replies] Last: LOL! -- Sorry. Cross-reference: http://www.cplusplus.com/forum/beginne... (by MikeStgt)
struct / class - Need pointers
 
Need Pointers on this, went through my book again trying to solve this question and running into brick walls define the struct studentType to implement the b...
[17 replies] Last: sorry fiji885 (225) ill read over the classes again, my brain is all... (by blackstar)
Unresolved issue
 
I am having a very similar question to this one .Can someone help http://www.cplusplus.com/forum/beginner/252049/
[1 reply] : Are you going to delete and run again if we do help? http://www.cplusp... (by salem c)
Create object of class inside (same) class
 
Hello, In C++, is it possible to create an object of a class X inside class X? For example inside a member function.
[3 replies] Last: class X { // some things }; class Y { X anXObject; }; ... (by Repeater)
Parameter confusion with class objects and overloaded operators
 
Hi, I have a friend function that overloads the insertion operator to deal with class objects. I'm confused because I'm not sure how it takes its parameter. ...
[3 replies] Last: std::cout << *this; std::cout << Rational(tempN, tempD); (by ne555)
problems with getline() and cin.ignore()
 
So, i got a problem where it would repeat "write something: " twice. Which i fount out was triggered by the getline(cin, user_input) or getline(cin, current_use...
[5 replies] Last: This last post by Handy Andy contains many of his own opinions. While ... (by Peter87)
Need help for a game
 
hi, guys, I'm having trouble in running my code. my first problem was that the winner was not always showing so I try to add if statement to declare the winner....
[1 reply] : This is why clear indentation matters. //System Libraries #include <... (by salem c)
SFML MUSIC (HELP!!!)
 
Hey, I was wondering if it was possible to play multiple music tracks at the same time. Does anyone know? (Music as in sf::Music music;) Is it possible to play ...
[2 replies] Last: Okay, thanks for the tip, I'll make sure my audio tracks are in the ri... (by Eristato)
by sturk
Prototypes for a default constructor
 
Why isn't 'Bar(const Bar&b)' a default constructor as well? Which of the following are prototypes for a default constructor? Bar(int a=0, int b=0); ...
[1 reply] : A default constructor is a constructor which can be called with no arg... (by JLBorges)
Create a 2D Array to Create a Gradebook
 
My assignment is to create a 2D array to create a grade book so that each student's name can be displayed next to all of the assignments. The text file I am r...
[6 replies] Last: I see the point you make. I did do another assignment with struct that... (by acscicplusplus)
Using fstream to fill a struct
 
I am creating a program that collects a class of max 30 students using a file. Each student has a ID code, 2 test scores and 7 homework assignments. The problem...
[no replies]
[Problem] Avoid having negative answers for subtraction.
 
Dear C++ community I am currently faced with a problem with how to avoid receiving a negative number for subtraction. My objective is to randomly generat...
[1 reply] : int index = (rand() % 4) +1; s = symb ; this says take an number ... (by jonnin)
How would approach this problem
 
INPUT: A list of daily wheat prices per bushel, one per day. OUTPUT: The maximum profit (per bushel) that could have been achieved by buying and selling on d...
[9 replies] Last: @ne555 Thank you once more for the link to Eddie Murphy's 'Trading P... (by MikeStgt)
Need help with (if,else) statements and Hello peeps!!!
 
Hi guys,first I would like to say "Hello Cpp Forum!"; I am a 44 year old boxing coach,that his friend enlisted in c++ course...hoping that it would regenerate m...
[3 replies] Last: You guys Rock!!! Thank you so much nicholasjb1996 and fiji885!! Now ba... (by NeonDolphin)
by sturk
C++ reason for compilation error
 
Can someone explain why does the code below give a compilation error? Revising for a test. Thanks What is the output of the following code? #include <ios...
[3 replies] Last: #include <iostream> namespace first { int var = 5; } namespace { ... (by closed account z05DSL3A)
April 2019 Pages: 1... 1213141516... 24
  Archived months: [mar2019] [may2019]

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