49,761 Topics
| |
I am trying to set up a 12 month table summary in a bank account program. The problem I have is I am trying to figure out how to set it up correctly. Here is my class and application from the bank account: Here's the class part: [CODE]class SavingsAccount { … | |
Can you anyone here tell me how to install DJGPP in windows 8 ? | |
i've been working on a game project, its a slider platformer and i've been having problem with getting the movement working, the movement is time based instead of being fixed to the frames per secound so the movement is consistent. the movement was working when i was testing out the … | |
I just built a new computer and I am trying to keep it as "clean" as possible. I have the purchaised version of VisualStudio 2008 but I dont know wether I should install that, or the latest express version? | |
hello. i doing my work and facing problem in "<<" operator i declare that method in the class public: friend ostream& operator<<(ostream& out, T theList); and in the main i am using that to print the list in this way cout<<"First List is \n"<<list1; but it creat error in the … | |
I am trying to have a C++11 compiler that works. It seems (if the publicity is right... and typically it never usually is!) that gnu g++ 4.8 might be it. So I installed Ubuntu 12.04 read the instruction on multiple sites, did EXACTLY as it was said, got (obviously) errors, … | |
#include<iostream> #include<conio.h> using namespace std; char square[10] = {'o','1','2','3','4','5','6','7','8','9'}; void box(); int checkwin(); int main() { char f, g, e[10]={'o','1','2','3','4','5','6','7','8','9'}; int a; int c, d; for(a=1;(a<=9);a++) { int b; system("CLS"); box(); if(a%2==1) { cout<<"player 1 enter your num\n"; cin>>b; } else { cout<<"player 2 enter you number\n"; cin>>c; } if(b==1&&square[1]=='1') … | |
In this code, I need to put a limitation in every part where the user is asked to input data. The user will be asked to input a grade ranging from 50-100, and if his input is not in the range, the program will display a warning, and if the … | |
I try to reference a struct from another class in my code and it gives me an error, saying I have a syntax problem. //Figure index struct FIGURE_TYPE { //Where to crop the image from SDL_Rect crop; int x; int y; }; That's the struct in Figure.h, void set_camera ( … | |
Another quickie. This is a basic class for working with Windows path strings. It's based off of .NET's System.IO.Path class, but doesn't contain any API dependencies (and thus doesn't normalize the paths, it's all straight string handling). Methods that I've personally found to be useful are included. The class is … | |
I am new to c++ and to using graphics libraries, so please forgive me if I have made a silly mistake. I am trying to compile a program that creates a window with one button from an example I found online. This is the error I get when I try … | |
Can someone tell me why I get this error "terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check Abort trap" when i run the following code? user and reservations are vectors of two classes else if (str == "lookup") { getline(cin, Name, '\n'); if (Name == user.at(i).getName()) { for … | |
Pleace help me with this!!!how can we change a decimal number into binary,octal and hexadecimal using c++???? | |
Hello members, I have started studying C++ with the book "C++ primer"( by Stanley B. Lippman, Josée Lajoie& Barbara E. Moo). I use Visual Studio 2012 Ultimate and make my projects on Win32ConsoloApllication. There was an example and I wanted to make it over for myself. #include <iostream> int main() … | |
#include <iostream> using namespace std; int main() { int rows = 3, columns = 3; int ****p; p = new int***(); *p = new int**(); **p = new int*[rows]; for(int i = 0; i < rows; i++) { ***(p+i) = new int [columns]; //Crashed at ***(p+1) why? } } I'm … | |
Hi all! I've just started working on my Binary Search Tree and already there's a problem that I can't seem to understand. Ok here's the problem, when I compile its ok but when I run it there's an error, i've managed to found where the problem is but I don't … | |
Does anyone know how I can add "0" to the left side of a string? If I get "1234" I'd like to make it "012345", if I get "1234" I'd like to make it "001234". Any suggestions? | |
#include<iostream.h> #include<conio.h> #define size 5 int stack[size],top=-1; void push(int s[size],int &t,int m); int pop (int s[size],int &t); void main() { clrscr(); cout<<"1-push \n 2-pop \n 3-exit \n"; int x,y; do { cout<<"enter number to choice:"; cin>>x; switch(x) { case 1: cout << "enter anumber to push in stack \n"; cin … | |
i am learning C++ from a good time now.. but I am still very confused sometimes in the use of array(char) and string.. can anyone please tell me that what exactly all differences between string and char array ? what can i do with array which i can't do with … | |
Hello everyone. I saw a post of one of our friends here about a problem he found of the SPOJ website. So I went there to check it. I found it to be very cool; I started to do the exercises but when I got in the 2nd, a prime … | |
#include<iostream> #include<vector> #include<stdio.h> #include<string.h> #include<stdlib.h> #include<algorithm> #define READY 1 using namespace std; typedef struct task_node { int task_id; int period; int wcet; int arrival_time; int deadline; int state; int ceu; int slacktime; }task; void read_input(vector<task> &); void print_task_vec(vector<task> &); bool comparebyperiod(const task&,const task&); bool comparebydeadline(const task&,const task&); bool comparebyslacktime(const task&,const … | |
Problem Statement: You are required to write a program for calculating area of Trapezoid. Formula for calculating area of trapezoid is Where a and b are two bases of trapezoid and h corresponds to height. | |
Hi programmers, I am a c# programmer but I have a very big project in C++ (Which I am not familiar with) and I am facing a big problem. As part of the project, I need to convert the image (any image of any type bmp,jpeg,png...etc) to grayscale using openMP. … | |
Dear Friends: I m hung up in Mod3 Ch5 Exercise 1. On line 149 (visible on my wiki below), the Xcode compiler throws an error saying that I'm not passing a valid parameter. http://www.jeffgeiger.com/wiki/index.php/School/CS270Mod3Ch5ProgEx1 As I understand it, remove(elem) takes an element and deletes any matching elements in the list … | |
In the following test case program I'M trying to figure out how I can use the remainder of divison to make a decision but I can not seem to get this test case to respond in the way that I think and want it to respond based upon the remainder … | |
I want to create an arrays pointing to the members of an object, something like this: // der1, der2, der3 or derived object of base class myobject{ der1 * d1; der2 * d2 der3 * d3 void do_op(){ *d3=*d1 + *d2;} // this must remain as time-efficient as possible typedef … | |
Dear friends: I am trying to convert a double to string format using the std::to_string function, but it gives me the following error message. i do not understand why the functgion does not support the double format. i use the vs2010. > error C2668: 'std::to_string' : ambiguous call to overloaded … | |
Can anyone tell me about this program how the delete tail work ? ..................................................................... void linklist::deleteSearchList(int id) { node * cur; cur = head; if (cur == NULL) return; // no node in list if (cur->link == NULL){ delete cur; head = NULL; }else if (id == head ->st.id){ cur … | |
Hello, I need to encrypt an image but my program is accepting 16 bytes of data for encryption from a file named plaintext.txt.. The program is encrypting data in blocks of 16 bytes that is the 1st 16 bytes are read then it is encrypted and saved in the ciphertext.txt … | |
I need help... I want to parallelize the MD5 algorithm using OpenMP in C++. |
The End.