General C++ Programming - September 2014 (Page 16)

Implementing collision detection correctly
 
I'm making a 2D Terraria-like (side-scrolling RPG with destroyable blocks) game with SFML 2.1, and I have no clue how to correctly implement collision detecti...
[7 replies] Last: Thanks, I think I finally have an idea of what I'm doing now. (by closed account ECoL3TCk)
Multiclassing
 
#include <iostream> #include <string> struct Class {}; struct A : virtual public Class { int num; A (int n) : num(n) {std::cout << "A::num = " << num << s...
[4 replies] Last: No, it's not the virtual inheritance that confuses me. It's why you wa... (by LB)
by Ispil
The Final SegFault; Hashtable for an Unordered_Set
 
Well, I've eliminated segfault after segfault, only having one more left- and this one's a doozy. Again, it is clearly labeled in the code Graph.cpp. #ifnde...
[8 replies] Last: Ignore them- they're really me just blabbering nonsense to myself. Any... (by Ispil)
by Dkob1
Code Problem
 
I tried it but I keep getting it wrong, I wrote what I have after the question. Given three variables , a, b, c, of type double that have already been de...
[3 replies] Last: I got it wrong though. (by Dkob1)
Updating An Array In A Grading Program
 
OBJECTIVE OF THE PROGRAM The program will grade a series of exams and then print a grade report for students in a course. Input: An instructor has a class of...
[1 reply] : You could have an integer for each grade. example: int grade10; int ... (by fabtasticwill)
Need help with Tic Tac Toe game program (specifically the while loop)
 
Hi, I have no idea why the while loop of my program isn't working. When my code is like this: int main() { while (gameState == 0) { playe...
[5 replies] Last: but it shouldn't prevent stuff from showing up on the console window.... (by giblit)
beginner,want this program to call the relevant functions,calculate final price
 
Hi I am a beginner in programming I want this programming to call functions choose between a customer type and call the relevent function to calculate the final...
[1 reply] : Use code tags http://www.cplusplus.com/articles/jEywvCM9/ #include... (by Bdanielz)
by Ispil
Segmentation Fault
 
I managed to get my code to a nearly-function state, but now I am suffering from an obnoxious segmentation fault. Note that this likely is not related to the mi...
[3 replies] Last: Yes, my silly mistake on 70 and 88. Fixed that up. As for 114, changed... (by Ispil)
Confused about this pointer arithmatic
 
/* strchr example */ #include <stdio.h> #include <string.h> int main () { char str = "This is a sample string"; char * pch; printf ("Looking fo...
[2 replies] Last: thanks so he should use str type int, not string... (by csstudent123)
Variable in system()
 
I have a bit of code which uses system() the command it gives has parameter1 which changes all the time. So I'm trying to put in a variable. My question, is thi...
[3 replies] Last: It is a namespace where all names from standard library are stored. ht... (by MiiNiPaa)
by vxk
Advice Pointers
 
what are the list of precautions that one should take while using "raw" pointers.Putting the question other way round , what are the mistakes that people make w...
[1 reply] : what are the mistakes that people make when using raw pointers. 0) ... (by MiiNiPaa)
by Ispil
Forward Declaration Mis-Match
 
Well, I've run into a snag. I have two classes that rely heavily on each other through references in particular functions. In fact, when I forward-declare both ...
[3 replies] Last: Nevermind, solved it myself- turns out that you can include one class'... (by Ispil)
Where do i start array to vector
 
i am new to programming and just recently graduated from high school taking my first programming class. i was assigned to modify this program so that pin 1, 2...
[2 replies] Last: > Where do i start array to vector Start here: http://www.mochima.com... (by JLBorges)
Using constructors in template class
 
The code below references to a header file and implementation .cpp file, which are not important. My question is what is the proper way to use a constructor in ...
[2 replies] Last: You have a problem with your includes... DELETE #include "pair.h" ... (by novellof)
by Ispil
Undefined Reference, Overloaded Operators, What?
 
This is for the same code as I mentioned in the earlier two questions. In this case, I need to figure out how to make a custom hash function so I can use the cl...
[5 replies] Last: Thanks! Go figure that it is always something little like that that ke... (by Ispil)
matching colors
 
I have to write a program for school that displays a random sequence of colored squares, each square is a different color. Then the squares disappear and the 5 ...
[2 replies] Last: c++ <iostream> <graph1.h> this is the code so far that I have. I jus... (by greatsoccerman)
by Ispil
A Mess of Pointers
 
Well, my code has reached an even more convoluted stage- I need to know how to access a particular element of a class. Sounds simple, except... Well, the object...
[3 replies] Last: Yes, that is exactly it. And yes, both are stored in a centralized loc... (by Ispil)
Do I need to delete threads?
 
Hi guys, if I create a new array of threads using the new operator (so I can use a variable sized array) like this: std::thread* foo = new std::thread ; ...
[7 replies] Last: It is quite straightforward: #include <iostream> #include <thread> #i... (by JLBorges)
passing page request via php
 
I need help guys, i want to write a c++ program that could pass a web page request, using a php script in a dns server. And also passed by the quested page to t...
[1 reply] : I'm not sure I understand. Why do you want to do this in C++? (by helios)
by Winsu
My program crash
 
I dont know what is happenings with my program, I have tryed to make a program fo create a matrix, with the same number of colums and rows,for that I have used ...
[4 replies] Last: [c ode] "Please use code tags" [/co de] matrix vec(a,vector<int... (by ne555)
September 2014 Pages: 1... 1415161718... 28
  Archived months: [aug2014] [oct2014]

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