General C++ Programming - December 2017 (Page 6)

Can't make the object collide with the walls in my maze game.
 
Can anyone tell me how do I make my object stop as it approaches the wall. It goes through the wall all the time. Here is my code. #include<iostream> #include...
[3 replies] Last: I tried Ganado's code, it didn't work for me. I think something is mis... (by SamuelAdams)
code Blocks: C++ - how can i use the directX?
 
using Code Blocks on C\C++, how can i use the directx? i belive that i need install some libraries, but i don't know. can anyone advice me?
[4 replies] Last: so by defauld i have the API. i did find some tutorials, but incomplet... (by Cambalinho)
by NBL
Functions C++ - Error in the output of my code
 
I was assigned this question: A Class of 40 students has received their grades for 5 exams (each out of 100). Write a structured C++ program (using top-down de...
[3 replies] Last: You need to seed the random number generator. Otherwise, random_shuff... (by doug4)
by oahz
What is a garbage value?
 
int a {0} ; a , a[-1], etc... will all produce "garbage values". Firstly, why does the "garbage value" spit out inconsistent values? What exactly is it? ...
[6 replies] Last: > int a {0} ; > a , a[-1], etc... will all produce "garbage values". ... (by JLBorges)
by Quro
Initialize members
 
Hi, I'm trying to learn C++ but am stuck on understanding the concept of initializing members. I don't know the reasoning behind this and how it works.
[6 replies] Last: Thank you (by Quro)
by oahz
What is "Narrowing"
 
Or what is "Narrowing Conversion"?
[3 replies] Last: because narrowing conversions are permitted in copy-initialization and... (by Cubbi)
Buffer Overflow
 
Hi guys just to begin with this is not for malicious purposes but I just find the concept of buffer overflow attacks fascinating,it's low level and really helps...
[15 replies] Last: its like sql injection -- the program fires up and executes normally u... (by jonnin)
"#define"d, but undeclared!
 
Hello, In the .h file, there are #define statements like: #define variable1 0 #define variable2 1 ... In the .cpp file, however, whenever the code re...
[1 reply] : First, isolate the problem. Write a separate program (if necessary) t... (by SSteven)
Using begin(string[]) in a class
 
Using begin(string ) in a class results in a compilation error: class S { string season; static const string seasons ; public: S() { ...
[1 reply] : On line 15, the declared type of the array seasons is an array of u... (by JLBorges)
by WOTS
2d Array Shuffle only
 
I need to shuffle a 2d array 3X3 TicTacToe so all numbers 1-9 show up in the array but none twice on the board to the right. Have managed to randomize it with ...
[5 replies] Last: If you're sure it shuffled on the first run, then it also shuffled on ... (by cire)
creating a password in C++
 
need help with a password checker I'm making #include "stdafx.h" #include <iomanip> #include <iostream> #include <string> #include <cstdlib> using namespace s...
[1 reply] : just index the string. if(password.length() == guess.length()) for(x ... (by jonnin)
void value not ignored as it ought to be” - What is wrong?
 
I created a class "semaphore" with a method "reader" this way: void semaforo::reader(sem_t x, sem_t y,sem_t z,sem_t rsem,sem_t wsem){ cout<<"-----------...
[2 replies] Last: with your explanation, I've been able to solve the problem, thank you ... (by anderezende)
by polip
struct and arrays
 
You are required to write a program for a magazine subscription company to handle their subscription list. The company keeps a large “database” that stores...
[5 replies] Last: Thanks Chervil But I don't think my program satisfy all requirements f... (by polip)
by wtbe
Gross pay array
 
Hi everyone, I'm in the process of working on a program using void functions to get the gross pay. When I call the functions in main the program isn't runnin...
[4 replies] Last: Hmm. It looks like for me to use void functions with arrays I need to ... (by wtbe)
Expression must be a modifiable lvalue
 
For some reason I can't get my addNewPurchase function to work. No matter which way I spin it, it will usually give me an error message stating that I need to h...
[2 replies] Last: You are trying to assign the new value to the existing variable. The ... (by doug4)
Please help in breaking into functions
 
I have created this program which inputs from user. The loop breaks if the user enters 0. The the program finds its total, Average and number of user inputs. ...
[9 replies] Last: that may be my fault. you can 'exploit' the sum function by calling ... (by jonnin)
Problem with template class and constructor
 
Hello I have facing a problem since 3 days about inheritence in constructor with template class : here is my code waitingCustomerQueueType.h #ifndef WAI...
[1 reply] : http://www.cplusplus.com/forum/general/113904/#msg622073 (by ne555)
How to access to a template child method from a parent class?
 
I have a base class from which a template class inherits: class Base { public : virtual ~Base() { }; virtual void Print() const = 0; ...
[1 reply] : The return type of a function must be known at compile time. Unless yo... (by Peter87)
by vr777
Mancala C++
 
***** MY QUESTION(S): So I'm at brink of finishing my project and I'm stuck and have a few issues. Firstly, I mention under rules for play mancala in TRICKS "...
[1 reply] : Do not double-post. Other thread: http://www.cplusplus.com/forum/begin... (by keskiverto)
How can I solve this Tower Building problem?
 
Hello, I am aware this might not fit C++ specifically, but I have nowhere else to ask this and I couldn't find it online in this format. Given n cubes, each...
[no replies]
December 2017 Pages: 1... 45678... 13
  Archived months: [nov2017] [jan2018]

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