General C++ Programming - November 2014 (Page 10)

by Myna
c++ program that count the occurrence of character in a text file and produce a histogram of the character count.
 
Here is what i have so far: #include<fstream> #include<iostream> #include<string> using namespace std; int main() { int sum=0; int count ; ...
[1 reply] : 1. Why do you need this second while -loop? Its body will never be ex... (by tcs)
Knight Tour Loops Problem
 
I'm trying to solve the problem for knight tour which each square only allow visited 1 time. #include<iostream> using namespace std; void printBoard(int );...
[1 reply] : 1. Your code is heavily unreadable. Please use [code ]/*Your Code Here... (by tcs)
How does OPL2 synthesis work?
 
I'm trying to find out how to synthesize the Adlib/OPL2 chip fully in software myself in C, but I can't find ANY information about how the chip works. Like how ...
[1 reply] : I'm assuming you were at least able to find an OPL2 doc that covers th... (by Disch)
Passing an array of pointers from a function to main()
 
I have a a group of text files that are used as input into a program. Another very similar program needs the same data in a different input format. I am writi...
[2 replies] Last: 1. The program above compiles well. 2. Line 10, 12: You've defined ... (by tcs)
by arj511
Simple Assembly Language problem
 
Write a C++ program which asks for 5 numbers to be entered by the user. The program stores the numbers in an array. It will then call another function, sort()...
[3 replies] Last: std::sort http://www.cplusplus.com/reference/algorithm/sort/ http://... (by LB)
Who wants to be a millionaire?!
 
I am making a program that is a game similar to who wants to be a millionaire. It has to read the the questions from the file and then display them, take the us...
[no replies]
WRITING A HARD PROGRAM!!
 
Ok
[2 replies] Last: File input: http://www.learncpp.com/cpp-tutorial/136-basic-file-io/ ... (by anup30)
Function pointer syntax.
 
Hello, I have a piece of code that sorts data based on some metric. The some metric is something I now want to make flexible so I can easily switch between...
[4 replies] Last: > It's going to take me some time to understand the syntax of placehol... (by JLBorges)
How to copy a .txt file?
 
...
[4 replies] Last: Would there be a way of doing it with the way I did it above? If I do ... (by jdougherty)
A Simple Problem
 
Create a user-defined program that will compute the price per square inch of a cake using an “overloading”. The cake could be a circle or a square type. In...
[4 replies] Last: The instructions call for using overloading. That means same function... (by PCrumley48)
by morv
Copy constructor and destructor in c++
 
Class Car{ Private: string* _ID; bool _isFaulty; int _location; int _timer; int _order; vector<Road*> _roadPlan; } I want to impl...
[3 replies] Last: You'll need to loop too. Also, you can't just delete _roadPlan, it's a... (by tipaye)
Passing an object constructor to push_back
 
Hi, I'm writing some code that reads in a number of lines and builds objects based on them, that are added to a vector. I know the format of the file, so the...
[5 replies] Last: That's the odd thing, there was really absolutely nothing going on exc... (by Gaminic)
Unresolved External symbol
 
I need help with this error message please: Error 1 error LNK2019: unresolved external symbol "public: __thiscall Book::Book(void)" (??0Book@@QAE@XZ) referen...
[3 replies] Last: You code has 2 constructors: This one - Declaration: Book(char t ,... (by tipaye)
by Lozy
Problem with reading a file into array of struct
 
#include <iostream> #include <fstream> #include <iomanip> using namespace std; struct inventory { int barcode; char description ; float price; ...
[1 reply] : infile >> s .barcode; cin.ignore(); You are reading from infile, bu... (by MiiNiPaa)
Simple Motor rotation control problem
 
I have an arduino board all hooked up to a servo motor that is going to control a mechanical claw. I would like to write and code where I can enter something li...
[1 reply] : What you need to know is the speed of the rotation. I.e. What's the de... (by coder777)
simple C++ fstream problems,May anyone help me?
 
I am in trouble for the simple C++ fstream problems,may anyone help me? void SinglyList::load(){ ifstream fin; Node* currNode=head; Node* newNode = ...
[4 replies] Last: also for cout the statement from cin,the whole explanation of load() ... (by loopfriend1234)
pointer problem?
 
void pointer(int* first , int* second , int* third ) { int a, b, c; first = &a; second = &b; third = &c; *first = b; *second = c; ...
[6 replies] Last: @Grey Wolf this even better thanks man (by zakelong81)
create random number as zipcode
 
hey everyone i am trying to create a zipcode I write my code like that and it only show "-2" on the screen what happen to my code I can not find mistake! help! ...
[1 reply] : You never call createZipcode, so zipcode is never initialized. One pos... (by ats15)
Text based detective game
 
Hey guys, I am planning to make a text based detective game. Right now i am stuck on in an area. My game is mainly like,i will dictate a scenario like a ...
[no replies]
by ajpc58
C++ Program Help
 
DOES ANYONE KNOW HOW TO DO THIS; I'M SORRY THAT IT IS SO MUCHH...NEED HELP!!!!!! Your main function should do the following: 1. Declare the array to h...
[2 replies] Last: you start off and we help after you get a start. ok? (by jasonwynn10)
November 2014 Pages: 1... 89101112... 32
  Archived months: [oct2014] [dec2014]

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