49,761 Topics
| |
Hello there, I am currently trying to solve Towers of Hanoi for N pegs using C++. I am implementing the towers in the form of a link list. Suppose there be three towers , TowerA,TowerB,TowerC Then for TowerA: 3 2 1 TowerB: - TowerC:- shall become TowerA: TowerB: 3 2 … | |
Hi all. I am trying to write a template class queue for an "assignment" and I got stuck by what I think is a syntax error. To be honest, the assignment was MUCH easier than that but after having it completed I thought to be interesting to explore new possibilities... … | |
These are the directions: Recursive Descent Parsing Consider the following BNF grammar: E -> T + E | T - E | T T -> P * T | P / T | P P -> I | (E) I -> a | b | ... | y | z … | |
With this piece of code when i call read i get the output [ICODE]Start of loop Archived filename = ./Data/Test.log End of loop Start of loop Archived File = DATA MANAGER End of loop[/ICODE] Edit: It is exactly what i want except it adds there odd characters at the end … | |
I had completed my code for my project, then decided to change it. I now have an error that I do not understand. C4715 which according to MSDN.com is 'function' : not all control paths return a value. The specified function can potentially not return a value. I have included … | |
I am trying to open a file in loop and print the data which my teacher request. however, there is blank in the out put file. and , how to indent the body of loop?? there is my code, please someone tell me what i did wrong!! thanks~` there is … | |
Hi everyone, I was writing a program and out of the 4 functions, one void function is giving 4 errors that I am not able to understand. The function is : void Conversion(double, double, char). I am posting my program, including the function that is giving the errors. I have … | |
Visual Studio 2005 is giving me heartburn while working with templates. Does anybody know what is going on with the following code, and the errors below? It says there is a syntax error, but I cannot find it. [CODE=C++] #ifndef DEQUEUE_H #define DEQUEUE_H #include <iostream> #include <list> template<class Item> class … | |
I am trying to implement a queue based on a Linked List that I had to write previously. It is templated and for some reason I am getting the following error using g++ when I compile: [CODE]g++ LinkedQueueMain.cpp -o LinkedQueueMain /tmp/ccqwStpK.o: In function `main': LinkedQueueMain.cpp:(.text+0x2ee): undefined reference to `LinkedQueue<char>::operator=(LinkedQueue<char> const&)' … | |
I am trying to implement the GSL uniform random number generator into my C++ program. Below is my entire program and I am having difficulties getting it to run properly. Any help would be greatly appreciated. Thanks for your time! [code=cplusplus] #include <stdio.h> #include <iostream> #include <math.h> #include <cstdlib> #include … | |
Can you use a static library on visual studio 2008 that was complied on visual c++ version 6 or do I have to recompile the static library? | |
im quite new to code and are using c++ to read files. Through some examples i have managed to read a file from top to bottom like this. The problem is that i will need to read the file from bottom to top instead. Is there a reversable method for … | |
Oooookay...this is really strange. I'm working on a program in MSVC++ 9.0 and it works fine when I hit "play" in the development environment, but when I manually navigate to the debug folder and click on the program, windows vista pops up an error saying that my "program has stopped … | |
I did all the coding, and I think that it is correct, but I dont understand why the program does not output the prime numbers!!! [code=cpp] #include<iostream> using namespace std; int main() { double newn; char ans; do { cout << "This is a program that will help you find … | |
[QUOTE=schamb;711245]also am curious as to how decimal to hexidecimal would work too just wanting to learn more about programming language and am very in experewienced[/QUOTE] You are going to have to get a lot more specific on these questions. General advice: 1. Read in a number in decimal. 2. Do … | |
Hey guys, I know you wont give me a direct answer, but that's not what I'm looking for. Here is the assignment: "Procedure: 1. Have the user input an integer between 2 and 19 (inclusive). If the number inputted is not within that range, reprompt the user again until a … | |
I have the following code (as you will see im using the same template as earlier...:$ [CODE] #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { int z = 1; int x = 2; int y = 3; bool b; b = (x < … | |
1,hi i need to create a program that will repeat the following 14 times.it needs to provide keyboard input that takes in hours worked in a day.after the 14 time it needs to show the hours worked. 2,the rate of pay is 6 pounds 50 pence. it needs to provide … | |
please tell me algorithm or code for following character sorting (Ascending) problem. For example Text file contains following data: 001, PSTR, abcdef, h.no.222 abcdefghik lmnopq rstuv, student, A-level 002, MKTO, abcdef, house. 2 abcdefghik lmnopq rstuv, student, rtv 003, LORR, abcdef, h.number.210 abcdefghik lmnopq rstuv, student, O-level 005, ASMP, abcdef, … | |
I thought I had this program licked and moved on to fixing the next problems, then ran it again and found out my while loop isn't doing anything. It goes into my loop, stops, and doesn't do anything else. If there was one item, it should move on to the … | |
i am writing a binary to decmal conversion program in c++ and am so lost just wondering if anyone out there could lend a hand to a lost soul also am curious as to how decimal to hexidecimal would work too just wanting to learn more about programming language and … | |
i have a machine problem to do. it should compute for the average grade of N scholars. N will be entered on the keyboard and the Student No. and Grades of the Scholars in *8 Subjects will be entered. sample output of program should be like this. STUDENT NO. S1 … | |
When using visual c++ does code that would work in other programs work as well? | |
Hi guys. I will explain the problem I have in my own words. I have to make a program using the Fibonacci numbers, in which the user inputs a number of days and the original size a green crud population, and every 5 days the population changes by fibonacci numbers. … | |
Say you have a class called example: [CODE]class example { int one; int two; };[/CODE] and you use this to get numbers from the user: [CODE]example number; cout<<"enter numbers"<<endl; cin>>number.one>>number.two;[/CODE] and then you call one function to manipulate the numbers and another to do some more manipulation. How do you … | |
Hello, I'm trying to simply copy the text from one .txt and create a new one and copying it to a new txt. I'm actually adding more text to that new file but that's not the part I'm having problems with. I could go through the entire .txt with this … | |
Hi everyone, I have a problem with debugging a dll file. I'm trying to convert the epanet2.dll (EPANET: a free source-coded water resource program) into a 64-bit dll file for my project. When compiling, errors coding LNK2001 and LNK2019 occurred many times. error LNK2001: unresolved external symbol ... error LNK2001: … | |
Hi guys... I'm a student having a bit of trouble with my assignment. The assignment is to make a program for a phone company to calculate call durations, costs, discounts etc... I need the user to input call start time in 24 hour style... and end time. In order to … | |
[code=cplusplus] // file celsius to F // calculate from c to f in the depth st #include <iostream> using namespace std; float celsiusAtDepth (float); float CtoF (float); int main () { float depth; float tempF, tempC; // get depth cout<< " Enter depth in Km " ; cin>> depth; //calculate … | |
Hi All, I'm currently working on my project (which try to perform degree reduction for a Bezier curve). I've spent a long time trying to find library or useful class to help me perform matrix inversion. For example degree reduction in Bezier's curve (let's say from degree 3 to degree … |
The End.