General C++ Programming - March 2019

by Jj1009
Reversi/Othello game
 
I am making a Reversi game where 2 AI's have to play against eachother. So far i have code where humans play but i need a program where only 2 AI's play. Her...
[1 reply] : Take a look at this: https://www.gamedev.net/articles/programming/arti... (by dudeawsomeness1)
How to Store different classes in one array or...
 
I'm not sure if I phrased the question right, but I'm looking to iterate through an array of similar objects like "projectiles and enemies " instead of havin...
[2 replies] Last: Thanks! Seems to be exactly what I was looking for. (by DevReign)
by Muiz
Having problem designing a constructor
 
Hello.. I am making a game called Ultimate Tic-Tac-Toe in which i have taken 2 classes.. 1 for small tictactoe abd other for ultimate one.. Class Ultimate ...
[6 replies] Last: Okay sorry for being rude (by Hammad Ali)
Adding Decimal problem C++
 
With my code at the moment it is suppose to repeat Assignment # each 10 times and Project # each twice, then to take all 12 answers and add them up in one giant...
[1 reply] : > that when I enter a decimal as a answer, my code then begins to scra... (by JLBorges)
rounding problem C++
 
For my C++ class we are trying to create a grade projector but the part I am stuck on is the entering of the Assignment score part and project part, which are j...
[2 replies] Last: There is nothing wrong with your loops. The only issue here is that ev... (by Hammad Ali)
sorting class member
 
i had a question, i'm using class with 3 private vector member, i want sort based on third member. pseudocode below. class test{ private: vector <int> a; ...
[4 replies] Last: thanks, JLBorges... i done ... although many i dint learnt before... (by blacksjacks)
Use setprecision to save number to variable
 
I'm trying to compare two numbers to each other, but only to a certain decimal point. For instance, 3.1459 to 3.1429. I wish to use setprecision to be able to...
[2 replies] Last: @mbozzi Great idea, I don't know why I didn't think of that. Thank you... (by Crusher21)
Rand() giving very similar output each iteration
 
I'm trying to use rand() to create pseudo-random numbers between 0 and 1 inclusively. I have the following code but each time I run it, I get a number very clos...
[11 replies] Last: VS2017 DOES have an up-to-date C++17/C++latest compiler. It defaults ... (by George P)
Need help determining the winner of this game
 
Okay so, I have the program working using vectors, but I can't seem to figure out how to make a winner, the program closes as soon as someone gets tic tac toe. ...
[1 reply] : nvm I didn't have system("pause) doi (by PistolPete10)
by PacR
Find multiple char sequences in char array.
 
Hello im trying to make a program to find names inside char array, but i get 4 errors: error: cannot convert 'char (*) ' to 'char (*) ' in assignment (line 20)...
[7 replies] Last: Thank you all for your answers i'm currently studying them, will mark ... (by PacR)
sort 2D string vector by selected column
 
Hi all, I am trying to sort my 2D vector by a selected column. My 2D string vector: a Wed Feb 13 07:59:50 SGT 2019 2 0 nil b Wed Feb 13 07:59:04 SGT 2019 5 0 n...
[4 replies] Last: It worked. Thank you very much! (by poopcupine)
by medosz
Can I have some help please?
 
I am trying to write a program but it is not working. This is the exercise that I should write. I am a beginner :) Thank you for your help :) Create a cla...
[9 replies] Last: I've done the program as you suggested. The calculation is still inva... (by medosz)
How to solve this question?
 
Victor and Francis are looking to buy a house in a new development.After looking at the several of models,the three models they like are colonial,split-entry an...
[6 replies] Last: I just know some basics commands only. #include<iostream> #include<io... (by Leewj9559)
help me please
 
This program is supposed to make an integer greater than 0 and less than 4000 put into roman numerals. I'm not having any errors, but when I run the program and...
[1 reply] : … 300 is >= 100, num = 300/100 = 3 ynum = 300%100 = 0 switch, writ... (by jonnin)
Code not entering if statement block
 
#include <iostream> #include <fstream> #include <sstream> using namespace std; #include "Shape.h" #include "Circle.h" #include "Rectangle.h" #include "Sq...
[1 reply] : watch your variables in a debugger "circle,3.5\nsquare,3" the input... (by ne555)
Saving objects to binary file with some caveats?
 
I have a project in my programming class that involves saving an object to a binary file. The class contains two string variables and an int. So, I would nor...
[8 replies] Last: You could write the data to a buffer and then write it to the file in ... (by dhayden)
Need help with this program. Very Confused.
 
Hi, Can someone please help me with this program? Create a group of classes that will be derived from a base class Boat using public inheritance. From class ...
[2 replies] Last: I'm really just not sure how to set these up. My professor didn't give... (by Refritos24)
Address of std::set content
 
Hi, i'm using a set to make a symbol table which is shared for usage between different classes. Can i safely assume that when i insert a string x, that string...
[2 replies] Last: thanks a lot! (by barnack)
by JonK
Beginner C++ Student
 
I get the must return a value error for the following code and can't figure out how exactly to call or reference the class so that I can access and call the mem...
[4 replies] Last: Ahh ok I will keep the code formatting in posts in mind thank you. New... (by JonK)
C++ HELP
 
For my C++ class my teacher wanted us to create a dividing calculator, that we would use the define DBL figure's to create the division table outline that has t...
[2 replies] Last: here, I would have used an enum most likely. (Why: these look like th... (by jonnin)
March 2019 Pages: 123... 9
  Archived months: [feb2019] [apr2019]

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