49,761 Topics

Member Avatar for
Member Avatar for jimmymack

[CODE]// rational.cpp - Script 9.5 #include <iostream> #include <string> // Declare the class. class Rational { public: // Constructor: Rational(int num, int denom); // The overloaded methods that implement // arithmetic functions: Rational operator+(Rational rhs); Rational operator-(Rational rhs); Rational operator*(Rational rhs); Rational operator/(Rational rhs); void print(); private: // normalize() will …

Member Avatar for jimmymack
0
152
Member Avatar for Sonia11

I am working on a program in which everyting is perfect except Unhandled exception at 0x0041180c that I am getting at run-time and the location its specifying at is: [CODE]void candidateType::setVotes(int region, int votes) { votesByRegion[region-1]=votes; }[/CODE] I have checked it numerous times but still not getting it. Any help …

Member Avatar for mike_2000_17
0
172
Member Avatar for jimmymack

So I have a book on C but have Dev-C++ IDE and was wondering if I could learn C from that book whilst using the Dev-C++ IDE? Many thanks in advance!!

Member Avatar for TrustyTony
0
535
Member Avatar for helpfullProgram

Hello everyone! I have found a really weird result when I display a 2D texture (with GL_QUAD) on the screen at a different size to what it normally is: E.G when I display a 64x32 image(texture) on the screen at 128x64 and it contains an alpha channel the pixelated borders …

Member Avatar for helpfullProgram
0
260
Member Avatar for jimmyo88

[CODE]void EmployeeSearch() { vector<string> file; string temp; ifstream infile("GROUP.txt"); while( !infile.eof() ) { getline(infile, temp); file.push_back(temp); } // done reading file infile.close(); string item; cout << "Enter an employee number to delete from the file: "; getline(cin, item); for(int i = 0; i < (int)file.size(); ++i) { if(file[i].substr(0, item.length()) == …

Member Avatar for jimmyo88
0
235
Member Avatar for Rocker Gang

Can anyone tel me the implementation of typeid operator and how its returning typeinfo reference.......

Member Avatar for mike_2000_17
0
152
Member Avatar for stereomatching

compiler : g++ of gcc4.5.2(minGW) os : windows xp sp3(32bits) [code] template<typename T, template<typename> class CONT = AccumulationTraits > class Accum { public : static typename CONT<T>::AccT accum(T const *beg, T const *end) { typename CONT<T>::AccT total = CONT<T>::zero(); while(beg != end) { total += *beg; ++beg; } return total; …

Member Avatar for stereomatching
0
148
Member Avatar for l1nuxuser

hello everybody. i bulding now a software with a data-base i am using MFC lib. i need help how to add, edit & use data base in vc++ tks biny.

Member Avatar for Ancient Dragon
0
202
Member Avatar for bpushia

This is my GPA Calculator, for a homework assignment. Please share what you would have added or remove from the code. Arrays is a requirement in this code. [CODE=c++]# include <iostream> using namespace std; int main () { float b [100], c [100], a, a1, average_GPA, total_credits, Cummalative_GPA; cout <<"Enter …

Member Avatar for Narue
0
6K
Member Avatar for programing

plz how i can write a program to pop from one stack and save the value deleted to onther stack .. means .. pop the top from one stack and push the delete value to other stack ... :(

Member Avatar for TrustyTony
0
133
Member Avatar for programing

plz i cant't correct the errors .. can any one correct this [CODE] #include<iostream.h> #define size 100 struct stack { int item [size]; int top=0 ; }; class m{ bool isempty(stack s) { if (s.top==-1) return true ; else return false ;} bool isfull(stack s); } return (s.top==size-1);} int count …

Member Avatar for programing
0
136
Member Avatar for Loki55

Starting to do arrays and my first question is... Wrtie a loop to print the elements of an array of int called numbers. You only know that the array has 5 elements. i My 1st attempt is going like this.... [CODE]#include <iostream> using namespace std; int main() { int number[5]; …

Member Avatar for ragedsparrow
0
102
Member Avatar for Mr. K

I am trying to move a ball using time. The ball must move 5 pixel per second. In my code the ball is moving faster. Why is it moving faster? What is wrong with my code? [CODE]#include <allegro.h> #include <cstdlib> #include <time.h> int ball_x = 320; int ball_y = 240; …

Member Avatar for Mr. K
0
116
Member Avatar for Haice

I am workinb on a face recognition application and i got stuck with creating and handling a credential dat will allow the application tl login or unlock windows... Help needed pls

0
49
Member Avatar for toferdagofer

Im trying to get this game to play again once the user gets the right answer or the guesses exceede 8. The problem comes in when i type in Y or N. It doesnt loop back up to the top of Do loop like i would like it too. Please …

Member Avatar for toferdagofer
0
173
Member Avatar for jamort

Ive been having a problem with faults and im not sure what exactly its coming from. I know that SDL_Flip(MainScreen) is causing it. bdround.Draw() is the only thing that changes MainScreen but i get the segfault even if i take that out. [CODE]/******* Edu.h Class edu(main part of engine) *******/ …

Member Avatar for mrnutty
0
97
Member Avatar for pseudorandom21

Hi, I'm starting to do some work with MFC and I was wondering why the design view seems to only work for dialogs? I'm using VS2010, is there a design view you can use with a simple SDI application?

0
82
Member Avatar for ronnieaka

here's the infix expression: [B]EXAMPLE 1[/B] a/(b+c)*d according to me, if [B]*[/B] is given higher precedence then [B]/[/B] , then this should be the postfix expression: [B]1) abc+d*/ [/B] if / has higher priority then * , then: [B]2) abc+/d*[/B] [B]question 1: [/B]which is correct?? 1 or 2 ? according …

Member Avatar for TrustyTony
0
239
Member Avatar for wildplace

so.. my professor ask us to read map(x,y) into a graph data structure and traverse using Breadth First Search. although i asked him for help, i still so lost..can someone please explain how should i start, such as what are some functions the graph class should has..and what they should …

Member Avatar for wildplace
0
105
Member Avatar for pravej

Hi All, I just wrote a program of string. In the below program every blank space will be replace by char 'x'. The program compiled successfully but it dint not run, give error. What I am doing wrong plz suggest me. [CODE]#include<iostream.h> using namespace std; int f1( char *st); int …

Member Avatar for pravej
0
143
Member Avatar for klangston92

Instructions: --For each day, tell which balloon (identify it by time released) traveled the greatest distance on that day (7 values printed). Identify the day by name rather than by number. --For each day, calculate and print the average distance (print one decimal position) traveled by all balloons released on …

Member Avatar for pseudorandom21
0
160
Member Avatar for pcgamer2008

Hello World ! How to load a Bitmap image or any other format in openGL ? I am so much confused where I need to begin my innings ? confused while studying lot of theories and concepts...plz can anyone tell me the steps from starting altough i have read some …

Member Avatar for mrnutty
0
86
Member Avatar for anitaNg

what is wrong with my code?i cant figure it out. [CODE] #include<iostream.h> #include<stdlib.h> #include<stdio.h> #define MAX 50 struct Node { char judul[MAX]; char pengarang[MAX]; int harga; Node* nextPtr; }; Node* makeNode(char judul[], char pengarang[], int harga) { Node* newNodePtr = (Node*)malloc(sizeof(Node)); if(newNodePtr == NULL) { cout << "Out of Memory" …

Member Avatar for jonsca
0
141
Member Avatar for porschedream

i am using the following code to tokenize a character array [CODE]for(int i = 1; i <= count+1; i++) { name[i] = strtok(NULL, "("); type[i] = strtok(NULL, ")"); b << type[i] << " " << name[i]; b << ";"<<endl; cout << type[i] << name[i] << endl; }[[/CODE] however in the …

Member Avatar for TrustyTony
0
869
Member Avatar for bfprii

I want to merge 2 or more hashtables together..It doesn't matter what the final form is, as long as I can iterate through it. Here the final form is an array. So I have an unsigned long long as the key, the value is a string,int pair. Each key maps …

Member Avatar for bfprii
0
205
Member Avatar for toferdagofer

i am having a lot of problems trying to create a Mastermind game. The goal is to implement it and have it print out a game board on the screen that has the previous answer move up as new ones are entered. Also its supposed to keep track of whether …

Member Avatar for TrustyTony
0
328
Member Avatar for ztdep

i write a point class, when i compile , vs2008 give me the warning about" not all control parth return a value" could you please tell how to avoid that? [CODE] double& operator [](int i) //[] which can used as the left value { if(i==0) return x; else if(i==1) return …

Member Avatar for ztdep
0
589
Member Avatar for kitjo

i have my interface built already and my sql database. i want to connect the interface to the database. i have four fields that is the lugword, meaning1, meaning2 and the search from the database can some ome help me

Member Avatar for anth0ny989
0
114
Member Avatar for Sorcher

[CODE]#include<stdio.h> #include<graphics.h> #include<conio.h> #include<malloc.h> #include<stdlib.h> #include<dos.h> #include<iostream.h> int k=1, i, user=0, dice=0, x1=50, y1=410, x2=70, y2=410, dir1=0, dir2=0, ch; int cnt1=1, cnt2=1; void *obj1, *obj2, *o1, *o2, *dot, *back, *turn, *ready; unsigned int size; void ladder1() { int m,n; for(m=0;m<=250;m+=250) for(n=0;n<=m;n+=250) { setcolor(DARKGRAY); line(53+m,57+n,55+m,55+n); line(53+m,57+n,133+m,137+n); line(55+m,55+n,135+m,135+n); line(133+m,137+n,135+m,135+n); setfillstyle(SOLID_FILL, YELLOW); floodfill(55+m,58+n,DARKGRAY); …

Member Avatar for WaltP
-1
139
Member Avatar for mwmnj

Hi, I am working on an exercise in operator overloading. I've created a matrix class and I am supposed to overload operators so I can do arithmetic on matrices efficiently. My directions say that I am supposed to make two matrix arrays using the class constructor that has 2 parameters …

Member Avatar for Saith
0
260

The End.