Forum: C++ 7 Days Ago |
| Replies: 0 Views: 161 Hi guys!
I am wondering how can one perform a sorted merge between the calling object list and the the passed in list?
Here is what I have got so far :
#include<iostream>
using namespace std;
... |
Forum: C++ Oct 26th, 2009 |
| Replies: 6 Views: 195 |
Forum: C++ Oct 26th, 2009 |
| Replies: 6 Views: 195 This will basically merge the two lists but I wont get the output the way I desire. I think it will join the tail of one list with the head of another list! |
Forum: C++ Oct 26th, 2009 |
| Replies: 6 Views: 195 How can you merge two lists of different size? Is it even possible? I thought you can only merge two lists which are of the same size.
After merging two lists, the original lists will be empty..no?... |
Forum: C++ Oct 26th, 2009 |
| Replies: 6 Views: 195 Hi all,
I am playing around with list and I figure out how to merge two lists and all. But I have no idea how can I integrate one list onto another. For example A = {1,2,3,4,10,11} and B = {... |
Forum: C++ Oct 7th, 2009 |
| Replies: 3 Views: 207 I fix that but I need help in writing the body of that +operator overloading function.
Thanks, |
Forum: C++ Oct 7th, 2009 |
| Replies: 3 Views: 207 Hello,
I am writing a class that can handle large number of digits.
I am trying to overload >> operator so that it can store the user input value and if user entered nondigit then it should... |
Forum: C++ Sep 23rd, 2009 |
| Replies: 5 Views: 229 check ur email (private message). |
Forum: C++ Sep 23rd, 2009 |
| Replies: 5 Views: 229 I fix both errors still I amn't getting any useful output. How can I print X and delete the X that was printed before? In this way, it looks like X is moving inside the maze?
Thanks for pointing... |
Forum: C++ Sep 23rd, 2009 |
| Replies: 5 Views: 229 |
Forum: C++ Sep 23rd, 2009 |
| Replies: 5 Views: 229 Hey guys,
I have written a recursive function mazeTraverse which finds the path of the mouse to find its food which is placed inside the maze. I am given a maze of of 15 rows and 25 columns. Mouse's... |
Forum: C++ Sep 19th, 2009 |
| Replies: 2 Views: 337 Hey guys,
I have written a recursive function mazeTraverse which finds the path of the mouse to find its food which is placed inside the maze. I am given a maze of of 15 rows and 25 columns. Mouse's... |
Forum: C++ May 2nd, 2008 |
| Replies: 3 Views: 418 1>driver.cpp
1>c:\users\owner\documents\visual studio 2008\projects\arrays\arrays\driver.cpp(9) : error C2440: 'initializing' : cannot convert from 'int' to 'opOverload'
1> No constructor... |
Forum: C++ May 2nd, 2008 |
| Replies: 3 Views: 418 I am working on this assignment, compiler is giving me 2 errors but I couldn't find any mistakes.
#include<iostream>
using std::cout;
using std::endl;
class opOverload
{
public:... |
Forum: C++ Apr 30th, 2008 |
| Replies: 10 Views: 1,604 I can use same idea to get the average as well? |
Forum: C++ Apr 30th, 2008 |
| Replies: 10 Views: 1,604 here is my updated one but still giving me an error :-
int List::sumOfNodes()
{
int sum = 0;
ListNode *currentPtr = firstPtr;
while( currentPtr != NULL)
{
sum = sum + currentPtr;... |
Forum: C++ Apr 30th, 2008 |
| Replies: 10 Views: 1,604 well that was my function and I got this error message
1>c:\users\owner\desktop\new folder\list.h(173) : error C2761: 'int List::sumOfNodes(void)' : member function redeclaration not allowed... |
Forum: C++ Apr 30th, 2008 |
| Replies: 10 Views: 1,604 I came up with this codes here :-
int List::sumOfNodes();
{
int sum = 0;
Listnode *currentPtr = firstPtr;
while( currentPtr ! = null)
{
sum = sum + currentPtr;
currentPtr =... |
Forum: C++ Apr 30th, 2008 |
| Replies: 10 Views: 1,604 Can anyone please help me to find the sum in the linked list. I have written codes to insert and remove numbers from lists but I have no idea how to calculate the sum.
void List::insert( const... |
Forum: C++ Apr 25th, 2008 |
| Replies: 9 Views: 656 last thing, why this program is not computing correct balance, after I set balance 120 and rate 13 and add credit 210 , it just adds up balance and credit but doesn't do anything wit the rate?
any... |
Forum: C++ Apr 25th, 2008 |
| Replies: 9 Views: 656 ok so I need to define like saving Account account1 = (120, 13) right?
gotcha! |
Forum: C++ Apr 25th, 2008 |
| Replies: 9 Views: 656 how can I fix it then?
thanks, |
Forum: C++ Apr 25th, 2008 |
| Replies: 9 Views: 656 oops I got it but still its giving me this error now ...." error C2664: 'SavingAccount::SavingAccount(const SavingAccount &)' : cannot convert parameter 1 from 'int' to 'const SavingAccount &' |
Forum: C++ Apr 25th, 2008 |
| Replies: 9 Views: 656 I have that! I have #include SavingAccount.h" in the class definition of savingAccount. |
Forum: C++ Apr 25th, 2008 |
| Replies: 9 Views: 656 I am working on this program and I am getting compilig error here is the code:-
#ifndef ACCOUNT_H
#define ACCOUNT_H
class Account
{
public:
Account(double = 0.0);
void credit( double);... |
Forum: C++ Apr 23rd, 2008 |
| Replies: 4 Views: 507 well, use sentinel value $ to terminate your loop. You should use while loop here
so something like ( while value!=$)...
Do some work and come for help. I can't write whole code for u! |
Forum: C++ Apr 16th, 2008 |
| Replies: 2 Views: 2,455 two dimesional arrays have to displayed as 2 dimension like a[i][j], you can't write them as a single array a[i]. I think this is why ur program is not compiling. |
Forum: C++ Apr 12th, 2008 |
| Replies: 4 Views: 1,040 ostream &operator<<(ostream &output, const Array2D &a)
{
for( int i = 0; i <a.row;i++)
{
output<<setw(4)<<a.ptr[i];
for( int j = 0 ; j <a.column;j++)
{
output <<setw(4)... |
Forum: C++ Apr 12th, 2008 |
| Replies: 4 Views: 1,040 here is my driver :
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include "Array2D.h"
int main() |
Forum: C++ Apr 12th, 2008 |
| Replies: 4 Views: 1,040 I have working version of code but mu ostream<< function should print data acoording to the row and column specified.
Here is the codes :-
//
// 4/11/2008
// This is a header file of Array2D... |
Forum: C++ Apr 11th, 2008 |
| Replies: 12 Views: 3,012 here is my copy constructor..anyone has idea how can I make it for 2d arrays( this copy constructor is for 1d array)
I have private varivales : column, row, size and double *ptr
... |
Forum: C++ Apr 11th, 2008 |
| Replies: 12 Views: 3,012 |
Forum: C++ Apr 11th, 2008 |
| Replies: 12 Views: 3,012 I am sorry I didn't get it. which line should I make changes? can u please show me?
Thanks, |
Forum: C++ Apr 11th, 2008 |
| Replies: 12 Views: 3,012 so I need to replace right with row * columns?? |
Forum: C++ Apr 11th, 2008 |
| Replies: 12 Views: 3,012 thanks, I have another question..how do I write this function for 2d array( I am accessing 2d array as 1d array so I know how to write in 1d)
const Array &operator = (const Array &);
for 1d it... |
Forum: C++ Apr 11th, 2008 |
| Replies: 12 Views: 3,012 how can I return the value in the end after I write down function like this :-
double Array::operator()(int row1, int col1)
{
int index;
index = columns *row1 + col1;... |
Forum: C++ Apr 10th, 2008 |
| Replies: 12 Views: 3,012 I have to write a program that created 2d array but store all data in a dynamically allocated 1d array. I have function definition and I know how to write up other functions but I need to overload... |
Forum: C++ Mar 20th, 2008 |
| Replies: 4 Views: 408 wow! its workin' YAY
Thanks a lot |
Forum: C++ Mar 20th, 2008 |
| Replies: 4 Views: 408 Hey I compile the program and have no errors however it is not outputting anything. Here is the new code :_
class Rect
{
public:
Rect(int length = 1, int width = 1);
int perimeter();
... |
Forum: C++ Mar 20th, 2008 |
| Replies: 4 Views: 408 Hi, I am trying to do my project but I am stuck. It looks like a big project but it is not. here is the question : I am given sample output of rectangles and some code. I need to add few free... |