49,761 Topics
| |
[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 … | |
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 … | |
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!! | |
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 … | |
[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()) == … | |
Can anyone tel me the implementation of typeid operator and how its returning typeinfo reference....... | |
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; … | |
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. | |
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 … | |
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 ... :( | |
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 … | |
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]; … | |
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; … | |
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 | |
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 … | |
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) *******/ … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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" … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
[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); … | |
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 … |
The End.