Beginners - March 2019 (Page 19)

by mke48
Undefined reference errors
 
I am using the code from here: https://github.com/MORTAL2000/Simple-Super-Mario- I tried g++ -std=c++14 Affectors.cpp Command.cpp CommandQueue.cpp DataTables....
[1 reply] : Maybe replace your Player.hpp with Player.cpp (by salem c)
Prime (1,2,3)
 
This program should find prime numbers but I don't know what is going wrong... #include <iostream> int main() { int num; for (num = 1; num = 100; ...
[57 replies] Last: One more try, now vector replaced by bitset in the hope its count... (by MikeStgt)
Help on a Theatre statistics program
 
hey guys, i'm new to programming and as such im not very bright when it comes to code. I've been working on a program that asks for "theater statistics" includi...
[7 replies] Last: Hello Splaterfix, You are welcome a lot. And I'm not sure why the... (by Handy Andy)
Is there a chance to access vector<bool> content byte- or word-wise?
 
Question: see title. Why? I'd like to count all true values by the sum of 'on' bits of a single char or unsigned int -- in the hope to be a bit faster.
[8 replies] Last: Thank you to all who answered, thank you for your time. OK, how many... (by MikeStgt)
Power of Recursion
 
Hello guys.I am interested is there a point of using recursion for some mathematical problems like factorial or binomial coefficients.I have read somewhere that...
[3 replies] Last: recursion can blow up the stack but the stack on modern computers is q... (by jonnin)
Card game
 
(Game: pick four cards) Write a program that picks four cards from a deck of 52 cards and computes the sum of the four cards. An Ace, King, Queen, and Jack repr...
[8 replies] Last: I tried right now and felt stupid because I had tried for(int i=0; ... (by sangamgyawali0)
by mpg
exercise with function c++
 
Define a function that, given the sales price of a total VAT product, returns the VAT-free price and the VAT amount (VAT at 20%) I write this code is good for ...
[17 replies] Last: Codeblocks (CB) is not a compiler. It uses a compiler. Its installer p... (by keskiverto)
help dat file
 
Hi, this program should obtain upper and lower characters from a dat file and once extracted, move each category into a new txt file. This code seems to run...
[15 replies] Last: Thanks for your code andy, however the code written above much more si... (by closed account 4wpL6Up4)
Using rand and while loops for Selection Menus?
 
Hello, I am in need of assistance on how to correctly output a selection menu using the rand function and while loops. I aim to have the line of code randomly o...
[2 replies] Last: #include <iostream> #include <random> // returns a random number fro... (by nuderobmonkey)
Variable/input data issue
 
Hey everyone, What I am trying to do is write a c++ statement that will give the user the option of entering up to seven separate sets of floating point num...
[2 replies] Last: Hello CWarrior987, The only thing I could add to what dutch has said ... (by Handy Andy)
Theatre stats program
 
I don't know why my age groups are not working. Here is a sample output. from ages 31 - 40 there should be 2 people and yet it only counts 1. Any ideas? ...
[2 replies] Last: The problem is line 36. The value is overwritten on line 101. (by coder777)
by ffloyd
only need your direction
 
(i got time limit exceed cause of generation of all subarray is okay but repeatedly sorting them for finding kth index is leads to tle. your direction will appr...
[1 reply] : So post your code. (by salem c)
by gjur99
Help with Program functions
 
Write your question here. #include <iostream> #include <iomanip> // Function prototypes //getLength,getWidth, getArea, displayData int getLength(int L); in...
[9 replies] Last: #include <iostream> double get_length() ; double get_width() ; doubl... (by JLBorges)
Im trying to make an average calculation when given 3 numbers
 
I am trying to make a program that when given three numbers calculates an average. The only problem is that it doesn't re ask correctly if a letter is put in. ...
[3 replies] Last: Thanks that should help (by dboyhade)
How to protect my program's files?
 
Let's say that I make a game using whatever libraries, SDL2, SFML, Allegro... You name it. But then if I was to release the completed project, in order for it t...
[3 replies] Last: Thanks a lot for the answers. Love the amount of detail, links and all... (by brianbathorycpp)
by mke48
undefined reference to cxx11::basic_string
 
I am trying to run the code here: https://github.com/PfAndrey/supermariohd/issues/1 When I try `cmake --build . --config Release`, I get all these `undefi...
[10 replies] Last: Just tried all your suggestions and none of them work (by mke48)
Can you assign 2 types to 1 variable?
 
so I'm a super noob at the moment and am trying to better my knowledge with simple practice programs. I want to be able to ask the user for an input which mostl...
[6 replies] Last: By coincidence, your last snippet of code avoided this issue, but plea... (by Ganado)
by colt
Operator overloading threevariables without tmp variable
 
Hello, I currently have this code: diffuse_color.red += light_intensity.red * lambert * mat.kd.red; diffuse_color.green += light_intensity.green * lambert...
[4 replies] Last: Ok, I am able to compile it and run it (after adding a "return color" ... (by cotro)
Completed a Program but Kattis thinks it's wrong?
 
Please Note: While my class has assigned Kattis problems before, I am completing this program on Kattis for my own practice, not for an assignment. I am doin...
[4 replies] Last: @doug4 Oh okay, thanks for clarifying. Didn't realize there was an on... (by PiggiesGoSqueal)
scope of vectors
 
Greetings, I have a question to scopes of vectors. Suppose I declare a vector (without initializing) at the beginning of main(). Now I enter a block, say a...
[2 replies] Last: Thank you very much Andy! (by PhysicsIsFun)
March 2019 Pages: 1... 1718192021... 25
  Archived months: [feb2019] [apr2019]

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