General C++ Programming - December 2013 (Page 35)

by Feemix
x++ not incrementing
 
i am converting each character from string into ASCII and i need size of array "x" to store them in array why didnt it increments "x" after cout? #in...
[1 reply] : You have two variables named 'x'. One is an int, declared on line 8, ... (by Disch)
Parsing a multidimentional vector into an array
 
For a rather complex and strange reason that I won't explain right now, I need to have this going on in my program. class FVF{ private: vector<vecto...
[4 replies] Last: And what would be nice is that the Boost library allows you to control... (by Duthomhas)
file loops
 
Hi I have university coursework due for next week on iterative Statements and nested loopd and I've really been struggling getting started. Once I get through t...
[1 reply] : So you have a single file that holds all the data, i.e. holds data for... (by ajh32)
Hello I want to solve this project and thank you
 
You are given a task to write a computer program for a Coffee Shop. Following is the table containing the list of product that you sell. Please be informed t...
[1 reply] : Can we see what code you have so far? This is not a forum for getting ... (by Mats)
convert the code
 
Please add alpha beta pruning in Minimax function in my program so my program or game tic tac toe can efficiently works ... #include <windows.h> #include <i...
[2 replies] Last: Minimax for tic-tac-toe is going so overboard anyway... (by Mats)
C++ program for bank loan
 
Please I need help with this, it's an assignment..thanks.. "The bank of Africa is giving loans. People should be able to qualify for the loan and when when th...
[1 reply] : Buddy atleast try something by yourself, if you are stuck then forum i... (by upX86)
TIC TAC TOE GAME , BEGINNER , PROBLEMS.
 
Hey! I'm a beginner in C++ and am in university atm. I have a code for a tic tac toe game tht has a few problems. (1) Assigning my X and O's to the array. Also ...
[2 replies] Last: Here is a way to check for horizontal wins. This is a general formula ... (by Mats)
const pointer function and pass by reference
 
I am having trouble allocating a new array , this is my old function it worked perfectly but now I need to change it to a const function for my HW assignmen...
[2 replies] Last: First: copy the content of student to New_StudentType which will b... (by coder777)
Problem Initializing Loop And Returning Values Rock Paper Scissors
 
When i return 0; at the function int userselect (int user, int comp)my output displays twice and when i ask the user to run it again the computers selection of ...
[1 reply] : I got it, when you return 0, you get the output twice because you call... (by aleonard)
BST Node and Count Function Don't Work
 
Hello there. I have to do a BST project for school and I am almost there. Here is the code: BINARY_SEARCH_TREE.cpp #include "stdafx.h" #include "genBS...
[3 replies] Last: Just print the returned values form functions cout << "Node Count: ... (by upX86)
Stack HELP Please
 
Given a text file, your program will determine if all the parentheses, curly braces, and square brackets match, and are nested appropriately. Your program shoul...
[no replies]
Input File won't open
 
First time asking for help so I am sorry if I do not give enough information. For homework I need to take a file of numbers (double) and fine their average. ...
[3 replies] Last: Try to give the absolute path to the file. (by upX86)
size of a dynamically created array
 
Hello. I have declared an array like: /***********Creating an m*p array**********************/ B = new int * ; for(row=0;row<m;++row) B ...
[3 replies] Last: function sizeof() will always return the size of data type, not the ... (by upX86)
Operator Overloading issue
 
Im trying to finish my code down below, it's getting errors.. please help :( #include <iostream> using namespace std; class Rectangle { int len...
[2 replies] Last: What exactly do you want to do with addition operator overloading, inc... (by upX86)
How could I double output some text?cout and ofs
 
if I want to output something, some string or some numbers to both the screen and a file. How can I do that? I tried: string name; ofstream ofs(name.c_s...
[6 replies] Last: [quote=cire] . . . code . . . <nosarcasm> Just tells me how much I... (by closed account 18hRX9L8)
tic tac toe game
 
void winner_x(){ string boar = {"-","-","-","-","-","-","-","-","-"}; if (boar == "x" && boar == "x" && boar == "x"){ cout<<"WINNER"; ...
[1 reply] : 1. You are resetting board every time, so nobody will ever win. You ha... (by closed account 18hRX9L8)
Read in string from file, and convert them into enum?
 
I defined enum boundaryType_t {inside, inlet, outlet, wall, periodic}; now I have file written like this: inside outlet I want my program read ...
[5 replies] Last: Oh, My god, Thanks a lot, Duoas! I think I need sometime to digest it!... (by northfly)
Extracting nibbles (binary)
 
If I have a number 117, represented in binary as : 01110101 and I wanted to grab the top nibble. What would be the decimal value I would be extracting? Wo...
[11 replies] Last: That does help.. Thanks very much. (by dominover)
C++ program to estimate the springtime count of deer in a park for 10 consecutive years
 
Hey guys I need help with this problem: Write a C++ program to estimate the springtime count of deer in a park for 10 consecutive years. The population of any...
[3 replies] Last: I will give you a hint. The problem is with your syntax in the "else i... (by josh26757)
cin.ignore()
 
Hello, I am trying to avoid using the cin.ignore() function. How would I write a line(s) that does the same purpose as cin.ignore()? I know what the cin.ignore(...
[2 replies] Last: But get() doesn't necessarily do the right thing. The best way is to ... (by Duthomhas)
December 2013 Pages: 1... 3334353637
  Archived months: [nov2013] [jan2014]

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