49,761 Topics
| |
So i am writing a program that plays the old memory card game (ie you have a 4x4 block of playing cards, flip 2, if they match they stay up, if not they flip back over). I am having trouble generating the random pairs of cards (i got the 4x4 … | |
Ive been having some trouble recently with a copy constructor (related to an assigment operator which is overloaded).... ive been getting segmentation fault, and Im pretty sure that i've narrowed it down to the copy constructor Anyway, here is my code for the copy constructor: [CODE] template <typename L> List<L>::List(const … | |
Hi I was wondering if you could help me with a question on image processing. I am using c++to process the image.I have a raw file, and I have read it by creating an fstream, and have saved the length of the file in variable end. [CODE] #include <iostream> #include … | |
I would like to implement a program that accepts if statements and then based on grammar rules provided, validates those statements by parsing each statement into tokens. I thought about it and thought that I would read each line in as a string, break it into tokens and validate each … | |
Hi, When I want to get a string with getline function, it jumps from this statement without getting string . Because I get an integer number before it and the \n is pressed . To solving this problem I use cin >> ws before getting string with getline function . … | |
Hello, I am having trouble in using the data member of class 1 in the member function of another class 2. Following is my code. [CODE]class a { public: a(); ~a(); std::vector<int> temp; }; class b { public: b(); ~b(); int test(); } b::b() { a *a1; a1 = new … | |
[code] #include <iostream> #include <fstream> #include <string> #include "LinDicT.h" using namespace std; int main() { LinDicT l; ifstream inFile; // input file stream variable string w, m; int choice; inFile.open("meanings.dat"); // open the input file if (!inFile) { cout << "Cannot open the input file" << "The program terminates." << … | |
I am attempting to write a program that evaluates a mathematical expression after parsing it. I have the parser correct, using a string to strip it into tokens and compare it to grammar rules to validate the expression. It should be able to evaluate expressions of type (3+2)*4+-1= where negative … | |
Im trying to set an existing registry key. [code] #include <iostream> #include <windows.h> using namespace std; int main() { HKEY hk; char* data = "VALUE"; RegOpenKeyEx( HKEY_CURRENT_USER, NULL, (DWORD)0, KEY_SET_VALUE, &hk); RegSetKeyValue( hk, (LPCTSTR)"Software\\Microsoft\\Command Processor", (LPCTSTR)"Autorun", REG_SZ, (LPCVOID)data, (DWORD)strlen(data)); } [/code] I get an 'Entry Point Not Found' error (The … | |
If you want to keep your brain thinking got a program that is fun to write. Winner gets prize uf done correctly. Description: Design and implement an application that creates a histogram that allows you to visually inspect the frequency distribution of a set of values. The program should read … | |
This is the problem i have to do: Use a 3 x 4 matrix (i.e., a two-dimensional array with 3 rows and 4 columns). Each row contains the 3 coefficients of an equation and the solution. For example, in the equations given in the book: 3x + 2y - z … | |
Is codeblocks an ANSI compiler compatible with gcc/g++/gpp (the GNU C/C++ Compilers)? | |
Hi there daniweb, i'm making a program that deals with a hill climber and genetic algorithm. I'm pretty much done writing the code but i'm having a headache of a problem....heres the header[CODE]#include <iostream> using namespace std; template<class T> class myVector { public: myVector(); int get_size() const; int get_capacity() const; … | |
Dear All, First of all, I do not know if this is the correct place or not but I am having problems about playing video by using opencv. I am trying to play an .avi video. I did exactly the same thing as tutorial but the code below does not … | |
im having a problem with my converter. this is my code : [CODE] void romanNumeral::convert(){ for(int i=0; i < roman.length(); i++){ letter = roman.at(i); switch(letter){ case 'M': case 'm': decimal += 1000; break; case 'D': case 'd': decimal += 500; break; case 'C': case 'c': decimal += 100; break; case … | |
Hello, I have this sort function that needs to be able to sort both strings and ints in a linked list. While the code I have does compile, It seems like it goes into an infinite loop and does not sort my elements. Can anyone see any problems or give … | |
[B]This is The function i have written to get waiting times of processes some one please help me to solve this[/B] [code] class NonPreemptive { public: int* getWaitingTime(int* process, int* arrivalTime, int* burstTime, int nProcess) { int ct[5],temp,j; int* wt = (int*)malloc(sizeof(int)* 5); wt[0]=0,j=0; for(int i=process[j++];i<=nProcess;i++) { if((arrivalTime[0]==0)&&(arrivalTime[j]<arrivalTime[j+1])&&(0<burstTime[j]<10)) { ct[i]=arrivalTime[i]+burstTime[i]+wt[i]; … | |
Hey, I'm pretty new to programming and I'm writing a program for my class. I can't figure out why my <iomanip> isn't working.. I'll post a copy of the code (I'm aware it's bugged, as it's not returning the proper values, but the format of the output is the issue). … | |
Hi Guys, I am trying to reverse engineer some of the openGl function into pure c++ and need some help. I can't use openGL but need to do some of the stuff it does. I am trying to figure out how to code glViewPort(...) in c++. Any help in this … | |
My teacher gave us an assignment where she wanted us to write a program that would read test score data from a text file,drop the lowest test score,average the other three test scores, and output the data to a text file. I've spent three days trying to figure out how … | |
Hello, I just finished my text-based RPG called Helsmich, however I need a few testers to find bugs/errors and tell me. There are quite a few variables that can be changed in the games such as your name, money, armor, weapon, kills, deaths, strength, speed, defense, accuracy, health, attributes, level, … | |
I have to call in two files, both have 20 letters in them. my program needs to be able to handle up to 50 chars and stop at the blank space. i need help getting the chars into the array and stopping at blank space [code] #include <iostream> #include <fstream> … | |
Hey guys. I am currently trying to get to grips with C++ and I am trying to create this little program. What I am trying to do is create a 'square' program, that prints out the entered number from the user, then prints the *'s to create a square. However, … | |
Hey guys, im having some trouble in finding what I should return with the [] operator overloading. Here is my implementation code: [CODE] template <typename L> L& List<L>::operator[](int index) throw (ListException) { if (index >= length || index < 0) { throw ("In function: operator[]: index >= length or < … | |
hey guys, I want to write a program to transform numbers to letters if I write 652 I want the program to print six hundred fifty two I have written this but I have a problem. For the 652... I get six hundred 5 2. The numbers are in spanish … | |
Hi all, Can any one tell me why this following code is not working. [CODE]#include <Windows.h> #include <iostream> #include <string.h> using namespace std; //Just a function DWORD WINAPI StartThread1(LPVOID iValue) { int iStart = 0; for(int i=iStart;i<=10000;i++) cout<<"i = "<<i<<endl; return 0; } //My Class class ThreadTest { public: ThreadTest(); … | |
im having some errors with my code. can someone help me fix it? =( this is my header file: [CODE] #include <iostream> #include <string> using namespace std; class dayType{ public: dayType(string); void setDay(string); string printDay(); string prevDay(); void nextDay(); string returnDay(); private: string weekDay[7]; int currentDay; string inputDay; }; dayType::dayType(string){ … | |
I need to know how to get this to calculate the maxvalue of my array. I don't really understand the whole initailizing functions thing. this is what i got so far. [code] #include <iostream> #include <cstdlib> using namespace std; //#include "stat_lib.h" int main() { double Ferdeg[100]; double celdeg[100]; double avg; … | |
Hi guys, I have to do the following, but I am not sure how to go about doing it. For example, I am trying to make my edit box change font color. So if the user inputs: Hello Everybody! I would need to change the color of the '!' to … | |
[code] //Student Name: Mohamad Amiruddin & Frank Douglas //Course: Diploma in Information Technology //Group: IT3 //Student ID: 0165-DDC-08 & 0684-DDC-08 //Program Name: Student Grade Report //Assignment Number: 1 //Assignment Name: Assignment 1 (Mini Project) #include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; //Content Declaration void reportHeader_weigtage (string … |
The End.