49,761 Topics

Member Avatar for
Member Avatar for Ponomous

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 …

Member Avatar for sfuo
0
87
Member Avatar for MooAndStuff

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 …

Member Avatar for MooAndStuff
0
1K
Member Avatar for davzi

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 …

Member Avatar for davzi
0
2K
Member Avatar for maverick0612

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 …

Member Avatar for Ancient Dragon
0
101
Member Avatar for Behi Jon

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 . …

Member Avatar for Behi Jon
0
145
Member Avatar for guest7

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 …

Member Avatar for sfuo
0
154
Member Avatar for nitrogen33

[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." << …

Member Avatar for Clinton Portis
0
76
Member Avatar for maverick0612

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 …

Member Avatar for maverick0612
0
118
Member Avatar for brando|away

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 …

Member Avatar for donaldw
0
254
Member Avatar for kennyted

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 …

Member Avatar for Ancient Dragon
0
79
Member Avatar for bigskinny1989

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 …

0
44
Member Avatar for Nikhar

Is codeblocks an ANSI compiler compatible with gcc/g++/gpp (the GNU C/C++ Compilers)?

Member Avatar for jbennet
0
153
Member Avatar for bpt0004

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; …

Member Avatar for bpt0004
0
95
Member Avatar for esesili

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 …

Member Avatar for Nick Evan
0
134
Member Avatar for kz07

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 …

Member Avatar for Nick Evan
0
97
Member Avatar for Jehutiy

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 …

Member Avatar for kvprajapati
0
101
Member Avatar for pavanbr143

[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]; …

Member Avatar for StuXYZ
3
408
Member Avatar for Cold_Demon388

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). …

Member Avatar for jonsca
0
457
Member Avatar for nu2cpp

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 …

Member Avatar for play_c
0
160
Member Avatar for paddowan34

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 …

Member Avatar for StuXYZ
2
114
Member Avatar for restrictment

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, …

Member Avatar for restrictment
1
354
Member Avatar for jigglymig1

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> …

Member Avatar for jonsca
0
86
Member Avatar for Alinthea

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, …

Member Avatar for mrnutty
0
89
Member Avatar for MooAndStuff

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 < …

Member Avatar for jonsca
0
103
Member Avatar for alexa868

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 …

Member Avatar for alexa868
0
104
Member Avatar for play_c

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(); …

Member Avatar for play_c
0
3K
Member Avatar for kz07

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){ …

Member Avatar for jonsca
0
89
Member Avatar for bigskinny1989

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; …

Member Avatar for jonsca
0
94
Member Avatar for scriptkiddy

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 …

Member Avatar for scriptkiddy
0
246
Member Avatar for amer_milo

[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 …

0
279

The End.