General C++ Programming - April 2015 (Page 16)

how to add multiple entries without predesignated names to a class
 
so Basically I know how to use classes to create an item system for my game, but im struggling with the inventory system, as I may have to have multiple types ...
[18 replies] Last: forget about helping, I figured most of it out... I still have shit t... (by closed account 2EwbqMoL)
Double hashing question
 
Hello there, I'm writing double hash table and have some question about it. This is my hash function below: unsigned int DoubleHashTable::HashFunction1(u...
[4 replies] Last: Smac, Thanks for reply. I will read out the links you provided. Like... (by likenew)
by Market
Work Problem
 
Hello, I am fairly new at C++ and I need to write a program in C++ that opens a csv file, parse the sections into arrays or vectors, and be able to output the...
[7 replies] Last: Work problem I need to write a program in C++ that ... Why C++? Ther... (by keskiverto)
Bigint Operations
 
Here I've got 2 classes, one is finished(a safeArray that I use for the second class which is what I have the problem with) In my bigint class I have add and su...
[1 reply] : On line 131, you are not beginning with the value 0. A newly created ... (by cire)
operators
 
class Complex{ public: Complex(double r=0.0 , double i = 0.0 ) : _r(r) , _i(i){} void set(double r = 0.0 , double i = 0.0 ) {_r = r; _i = i;} double ge...
[1 reply] : Please edit your post and make sure your code is [co de]between cod... (by LB)
array histogram random number
 
why wont this execute. i keeping getting { undeclared and old-style format error #include <iostream> #include<stdlib.h> using namespace std; #include <strin...
[3 replies] Last: http://www.cplusplus.com/articles/jEywvCM9/ (by TarikNeaj)
by Market
Covert Java to C++
 
Can someone please help convert the following code to C++. I am trying to read a csv file and parse it into columns. Thanks import java.io.*; import java.ut...
[1 reply] : #include <unordered_map> #include <fstream> #include <string> using ... (by Smac89)
BST tree
 
#include "BST_CLAS.h" template<class type> BST_CLAS<type>::BST_CLAS() { root=NULL; current=NULL; previous=NULL; } template<class type> node<ty...
[1 reply] : Please edit your post and make sure your code is [co de]between cod... (by LB)
Linked List Operations
 
So I've got a linked list data base using templates which compiles fine and lets me print out a list of all states and lets me search for a person and print all...
[3 replies] Last: I still see " print_people_in_state " inside your template class. As I... (by LB)
Birthday Paradox
 
Hi, I am new to C++ and I am trying to teach myself. I am currently working on the Birthday Paradox. My code is below, I think the way I am initializing the arr...
[3 replies] Last: > I create a for loop to loop through each 2 through 50 people iirc yo... (by ne555)
by nad1
Enum
 
how to return a value from a function as enum? typedef enum { MALE, FEMALE } Gender; for this example, if i want to return MALE as a return value to the f...
[3 replies] Last: enum class is a single keyword that just happens to contain a space.... (by LB)
connecting with socket
 
hey there I programmed a socket code that binds to a port with port forwarding. when i open the program, it binds successfully and open port checkers find my ...
[15 replies] Last: Ah, yes that is true. Sorry for the misunderstanding. (by LB)
1st memory allocation bug - can anyone help me find it?
 
I'm sure I did something n00bish here. I must have. I finally got that inventory system almost working - well, it probably would be (if I didnt have this darn b...
[18 replies] Last: Look up polymorphism. You can store all your instances in a std::vect... (by LB)
by Armaan
Math Game
 
Trying to make a Math Game Called “22” by programming. Two players will be able to play the game at a time. The rule of the game is, one has to AVOID making...
[9 replies] Last: >That's why i asked if someone could solve it. > human v/s human ok. ... (by anup30)
by saisr8
inheritance
 
How do visibility modes affect inheritance? Explain with examples.
[2 replies] Last: This is like your 4th post within 1 hour about inheritance. Like @Mike... (by TarikNeaj)
Stuck, Need Help!
 
I am trying to make my code analyze the data and then output the info, but I am doing so with arrays because it is less time consuming. I keep running the code ...
[3 replies] Last: @mjamesball9 Why are you using the comma operator in these lines? i... (by MikeyBoy)
by Addsy
Snake Game
 
Hi guys. I am creating a snake game for a project and am massively stuck on something. I'm trying to make the snake move in a 2D grid array. To explain this f...
[5 replies] Last: std::make_pair(x,y); (by S G H)
by saisr8
classes
 
please define the following and give suitable examples (i)Abstract class (ii)Virtual base class. (iii)Containership
[1 reply] : Read this: http://www.cplusplus.com/doc/tutorial/classes/ http://en.c... (by coder777)
by saisr8
inheritance
 
simply Define inheritance and a few needs. of it
[1 reply] : Did you read this? http://www.cplusplus.com/doc/tutorial/inheritance/ (by DVSProductions)
by kinK
appointment
 
I have to code a menu based program using functions and parallel arrays to keep track of weekly appointments from monday to friday. The user should be able to a...
[3 replies] Last: interesting http://www.cplusplus.com/forum/beginner/162238/ (by shadder)
April 2015 Pages: 1... 1415161718... 28
  Archived months: [mar2015] [may2015]

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