Beginners - December 2019 (Page 9)

Why does my Pong ball collision code sometimes not work
 
I'm creating a pong game with C++ for a University project. I have this snippet of code that check to see if my ball sprite has hit the boundary of my screen. W...
[1 reply] : 1. Why is ball_direction a different object to ball ? It's motion is j... (by salem c)
unexpected whitespace in char array output
 
I wrote this code trying to reverse a char array. Can someone please tell me why there is a whitespace in the output? I'm already accounting for the NULL charac...
[3 replies] Last: Got it. Kinda feel like a dummy, but hey, I'm still really new to C++.... (by AaronBoyd)
DO LOOP FOR GAME ERROR
 
hey guys just want to know how come i give a choice to play again but my program crashes and the numbers of hp,armor comeback negative? i want it to play the ga...
[5 replies] Last: never mind i fixed it. apparently i had to change the getline(cin,temp... (by Gerardo559)
by Djpich
Making the probability of a fitter number getting picked higher.
 
So I have to make a mating pool and with it a sort of raffle for the fittest strings. The problem I'm facing is that I am stuck how to go about making a raffle ...
[no replies]
Easy C++ coding
 
These are the instructions. This is a simple program to calculate stock prices based on user input. For instance, if Kathryn bought 750 shares of stock at a ...
[4 replies] Last: Hello herhsey1234, Lets see if I get reported again. A good start, b... (by Handy Andy)
Passing Lambdas
 
So I saw at some point someone said something(wow, super specific, I know) about how lambdas in c++ we’re just syntactic sugar for a previous thing of making ...
[4 replies] Last: Ok. Thanks! (by highwayman)
How to call this function in main() in cpp
 
I am trying to use the following remove() function in the main() function. Please let me know what is wrong with my current code. float remove(float a , int&...
[8 replies] Last: If you'd named your parameters with meaningful names, this would have ... (by Repeater)
How to use bool efficiently
 
How am I able to input any name into my bool, but only one name can be true. Here's my code below so far. int main() { bool a; cout << "Enter th...
[2 replies] Last: Thank you! (by LauMan10)
Extremely basic question( undefined ref )
 
So I thought I could solve this pretty trivial problem myself but to the contrary. I have a Stack header and a Stack source file containing the definitions ...
[3 replies] Last: would this be the problem? - https://stackoverflow.com/questions/4950... (by mbozzi)
Taking 2 points input
 
Hey there! I want to take input of only 2 decimal points. It means, if I give 2.54578, it'll just take 2 54. How can I do it?
[3 replies] Last: https://www.learncpp.com/cpp-tutorial/4-4a-explicit-type-conversion-ca... (by deleted account xyzzy)
by zet343
SFML and Qt Creator
 
Hello, I'm new to C++ and programming and I'm trying to make a graphic application with Qt Creator. I've downloaded a MinGW compiler that also comes with SFML (...
[10 replies] Last: So after downloading the environment recommended in the book, I got th... (by zet343)
Problem isn't answer true.(2)
 
Question and code which ı wrote below.I wrote this code by using flow chart.Everything seems true but when ı compile tis code its answer wrong.Please help me....
[6 replies] Last: Your question is ambiguous, @whitesoldier. Besides the fact that you a... (by lastchance)
struct is not working, I tried making a tree
 
Could you please explain to me what exactly am I doing wrong? I followed the tutorials and it still gives me an error. Thanks in advance :D #include <iostrea...
[1 reply] : tree is a type, not an instance variable you can use. You have two th... (by salem c)
Coding in C++
 
10. These are the instructions: This is an updated version of assignment from a previous chapter that calculated the minimum and maximum values. This version ...
[2 replies] Last: Homework questions are for you to code, so you learn from the experien... (by deleted account xyzzy)
Constructor
 
Hi, I have in class private char* region. I need create constructor which takes as argument data of type char* and on the basis of that data constructor determ...
[9 replies] Last: Thanks. I am beginner in C++ and in work with pointers, but I think th... (by Agent 003)
by mlinhy
Need help with arrays
 
Im not sure if my program is correct & need help checking it.
[1 reply] : What's wrong with the program? It compiles and run fine at my system. ... (by nuderobmonkey)
reading a character using readconsoleoutputcharacter
 
i am trying to read a character on screen (to be fed to another function) using readconsoleoutputcharacter from windows.h (i know it is not ideal but i am using...
[3 replies] Last: i have adjusted the code for a function to the following. how can this... (by tunplus)
by Jarias
C++ database android App
 
So im trying to create a database app for a company where they can store all their clients information. Im just starting out with coding but i decided this was ...
[no replies]
Problem isn't answer true.
 
Question and code which ı wrote below.I wrote this code by using flow chart.Everything seems true but when ı compile tis code its answer wrong.Please help me....
[2 replies] Last: Okey,how is it going to be ? (by whitesoldier)
core dump error
 
I'm running into this error that I can't figure out. The program runs and outputs everything correctly, but then I get this at the end: terminate called aft...
[2 replies] Last: Oooooh, I see it. I think I've got it. Thank you for the fast repl... (by closed account 1Ck93TCk)
December 2019 Pages: 1... 7891011... 13
  Archived months: [nov2019] [jan2020]

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