Showing results 1 to 40 of 103
Search took 0.01 seconds; generated 1 minute(s) ago.
Posts Made By: mrboolf
Forum: C++ 17 Hours Ago
Replies: 6
Views: 125
Posted By mrboolf
Re: C++ program help

You should remove default values for default arguments from your functions definitions.

For example this code #include <iostream>

int myfunction(int one, int two = 2);

int myfunction(int one, int...
Forum: C++ 18 Hours Ago
Replies: 2
Views: 90
Posted By mrboolf
Re: TCP client

The amount of people that'll help you is somehow proportional to the effort you'll show, not to the number of threads (http://www.daniweb.com/forums/thread160149.html) you'll open.

I'm less than a...
Forum: C++ 18 Hours Ago
Replies: 6
Views: 125
Posted By mrboolf
Re: C++ program help

Check your variable typing (i.e. Max_Lines instead of Max_Line in line 66 but I also read countAlpha instead of alphacount elsewhere).

Also, you should pass lines as argument to the function...
Forum: C++ 19 Hours Ago
Replies: 11
Views: 104
Posted By mrboolf
Re: helpppp

I am here to learn. Sure I'd like to earn money with my work someday - but with a honest WORK. This is not a work, is helping some cheater who thinks he's better than the others, and I don't like to...
Forum: C++ 19 Hours Ago
Replies: 11
Views: 104
Posted By mrboolf
Re: helpppp

Well you misunderstood me completely, I think.
I'll assume it's my fault, so I'll try to be clearer:

There's not a single person here that will do your homework for you. And I'd add "thank God for...
Forum: C++ 19 Hours Ago
Replies: 11
Views: 104
Posted By mrboolf
Re: helpppp

LOL, what code?!?
well, if you're not lazy beyond hope of recovery... :P

Some people (me included) could feel offended by posts like yours - being offered money for what? homework?
Try to follow...
Forum: C++ 21 Hours Ago
Replies: 5
Views: 123
Posted By mrboolf
Re: C++ problem

Seriously, how much do you think we care? Moreover, I hardly think so. I'm pretty sure that you won't hold gratitude or appreciation soon after you'll hand that assignment. Not that I'd pay a penny...
Forum: C++ 1 Day Ago
Replies: 3
Views: 91
Posted By mrboolf
Re: Write a function min that has three string parameters and returns the smallest.

You have extra parentheses: write this if(strcmp(a,b) > 0) && (strcmp(a,c) > 0)

like thisif(strcmp(a,b) > 0 && strcmp(a,c) > 0)
Forum: C++ 2 Days Ago
Replies: 7
Views: 127
Posted By mrboolf
Re: Find all subsets of a given set - Optimization?

My ideas are bit(s) clearer now :P
Now I should be able to work out the rest of the assignment.

Thanks again for your time!
Forum: C++ 2 Days Ago
Replies: 7
Views: 127
Posted By mrboolf
Re: Find all subsets of a given set - Optimization?

Thanks again!

Is you supersonic code meant to become something like this? (I am not practical with bitwise operators so it took me a while to figure this out)
long long unsigned int n =...
Forum: C++ 2 Days Ago
Replies: 3
Views: 64
Posted By mrboolf
Re: help my out put isnt working

I think that in line 89 you should put [i] after your usagekwh array in the cout statement.

Just had a first glance at your code though.
Forum: C++ 3 Days Ago
Replies: 7
Views: 127
Posted By mrboolf
Re: Find all subsets of a given set - Optimization?

Thanks for your reply.

1. You're right, absolutely. Even with N = 30 it takes just ~36 seconds to complete the loop without any printing. :) I didn't know printing calls were so expensive...
2. I...
Forum: C++ 3 Days Ago
Replies: 7
Views: 127
Posted By mrboolf
Find all subsets of a given set - Optimization?

Hi all there.
I was given the task to implement a Subset class with a few function.
It should be structured so to contain the original set and make it possible to generate all subsets.
Right now I'm...
Forum: C++ 6 Days Ago
Replies: 19
Views: 317
Posted By mrboolf
Re: sorting array with respect to name and CGPA

Ok, I'll try to be nice:

1 - Don't (repeat: don't) PM for help. I'm not your friend nor your tutor.

2 - Moreover, don't (repeat: don't) ever ask things like "please write for me the full program....
Forum: C++ 6 Days Ago
Replies: 7
Views: 149
Posted By mrboolf
Re: cout types

a is not a char, is an array of char. you have to print its component one at a time.
Forum: C++ 6 Days Ago
Replies: 4
Views: 97
Posted By mrboolf
Re: Simple C++ Class problem

I don't understand what you are trying to do - but my suggestion was to write a constructor for your B class like this B::B() {
ob = new A(5);
} so that every time an object of type B is...
Forum: C++ 6 Days Ago
Replies: 4
Views: 97
Posted By mrboolf
Re: Simple C++ Class problem

You should write your B class like this:
class B {
A *ob;
};and then in B constructor add ob = new A(5);

I think you can't call constructors from within a class declaration.
Forum: C++ 6 Days Ago
Replies: 7
Views: 144
Posted By mrboolf
Re: Class declaration syntax error

Post all the code you tried to compile, please. I can't see any error in this part.

Also, #include <string>, not string.h. And since you include it, why not use std::string name;?
Forum: C++ 7 Days Ago
Replies: 32
Views: 335
Posted By mrboolf
Re: Help with Hangman diff

if you saved your file as DRAW.h then #include "DRAW.h" will work, unless you placed the file in a random folder of yours. In that case, you'll need to enther the full path (e.g. #include...
Forum: C++ 7 Days Ago
Replies: 32
Views: 335
Posted By mrboolf
Re: Help with Hangman diff

Sorry, I read only the last 3 posts - but shouldn't it be d.rope(); as well as d.head(); ?

And you don't want draw::draw(), as VernonDozier already said. Just draw d;
Forum: C++ 7 Days Ago
Replies: 4
Views: 87
Posted By mrboolf
Re: code

I think the question is: "are you able to read this?!?".

I'm sorry, I'm not :( ...
Forum: C++ 8 Days Ago
Replies: 7
Views: 144
Posted By mrboolf
Re: Class declaration syntax error

You are missing semicolon ; after your class' closing bracket and the assignment name = "Player"; should be strcpy(name, "Player");
Forum: C++ 8 Days Ago
Replies: 19
Views: 317
Posted By mrboolf
Re: sorting array with respect to name and CGPA

If I understood correctly your question you are asking how to use getline with some member variable of a struct.

Look at this and you should figure out with ease how to finish:
std::string...
Forum: C++ 9 Days Ago
Replies: 19
Views: 317
Posted By mrboolf
Re: sorting array with respect to name and CGPA

As a start:

struct student {
std::string name;
char gender;
int CGPA;
};

and then access the members like this:
Forum: C++ 9 Days Ago
Replies: 12
Views: 205
Posted By mrboolf
Re: Square Root of -1

If you are making a complex class you should return a complex object, and it should not be the first operand. I mean given z and w two complex number, the instruction z + w should not modify z!...
Forum: C++ 11 Days Ago
Replies: 4
Views: 86
Posted By mrboolf
Re: Array Algorithm

If both array1 and array2 contain 25 elements then you should write your for loops for (count = 0; count < 25; count++) as arrays of n elements are indexed from 0 to n-1.

Moreover, the second cout...
Forum: C++ 11 Days Ago
Replies: 8
Views: 206
Posted By mrboolf
Re: C++ homework...Please help!!

No, I fear it's not like this.

First, why do you open "ProjectInfo.txt" ? If you open it to actually load the info in the numDays array then you should do it in another function and pass to this...
Forum: C++ 11 Days Ago
Replies: 8
Views: 206
Posted By mrboolf
Re: C++ homework...Please help!!

Post an attempt and we will help you fix the errors, if you encounter any.

Try to take one step at a time towars the ultimate goal of a complete and working program.
You managed to get input from...
Forum: C++ 12 Days Ago
Replies: 7
Views: 99
Posted By mrboolf
Re: Inheritance Trouble

Protected means private but inherited like private (hence accessible) by derived classes. If you declare them protected they'll behave just like if they're private. There's a table in the link I...
Forum: C++ 12 Days Ago
Replies: 9
Views: 115
Posted By mrboolf
Re: Recursive program issue

That's not where the problem lies. {
if input == 1
return recursiveGCD;
if input == 2
return iterativeGCD;
}
is wrong both from the syntax point of view and logically. You miss some...
Forum: C++ 12 Days Ago
Replies: 7
Views: 99
Posted By mrboolf
Re: Inheritance Trouble

Take a look at this (http://www.cplusplus.com/doc/tutorial/inheritance.html), it should explain the general concept :)
Forum: C++ 12 Days Ago
Replies: 7
Views: 99
Posted By mrboolf
Re: Inheritance Trouble

Your D class does not inherit from class A. You should write class D : A
{
// your code here
}; to inherit from class A.
Forum: C++ 12 Days Ago
Replies: 18
Views: 315
Posted By mrboolf
Re: Need homework help

If you set something to 0 you can double it for a lifetime - it will never become something different than 0.

Think on using a loop to add the dailySalary to the total earntMoney for each day of...
Forum: C++ 12 Days Ago
Replies: 4
Views: 116
Posted By mrboolf
Re: Question regarding base class and derived class

Thanks for pointing this out - it's good to learn something from someone else's question :)

At a first glance I prefer niek_e solution because it looks plain and clean, but I'll read carefully your...
Forum: C++ 12 Days Ago
Replies: 2
Views: 108
Posted By mrboolf
Re: char arrays and strcpy trouble

strange, #include <iostream>

using std::cout;
using std::endl;

int main(void) {
char * word = new char [20];
char temporal[ ] = "hola";
strcpy(word, temporal);
cout << word << endl;
Forum: C++ 12 Days Ago
Replies: 4
Views: 116
Posted By mrboolf
Re: Question regarding base class and derived class

I haven't tried something like this yet and I'm pretty new to classes on my own, however I think that the typeid operator would be the right man for the job.

Look at this...
Forum: C++ 12 Days Ago
Replies: 10
Views: 163
Posted By mrboolf
Re: ARRAYS

I suggest you to read this (http://www.cplusplus.com/doc/tutorial/arrays.html) before you ask more questions. Read it carefully and you should be set an gone, and in case of doubt come back here for...
Forum: C++ 12 Days Ago
Replies: 8
Views: 206
Posted By mrboolf
Re: C++ homework...Please help!!

Apart from useless variables (numDays array and m) I think your main problem is that the events array just contains garbage data: it is not initialised anywhere. If you intended to use another events...
Forum: C++ 12 Days Ago
Replies: 10
Views: 163
Posted By mrboolf
Re: ARRAYS

well you could use loops, something like
for(int i = 0; i < 20; i++) {
for(int j = 0; j < 60; j++) {
myarray[i][j] = "code for random number";
}
}
Forum: C++ 12 Days Ago
Replies: 10
Views: 163
Posted By mrboolf
Re: ARRAYS

a one-dimension array is defined by type name[dimension]; or explicitly type name[] = { element1, element2, ... , elementn } where n = dimension. It has exactly n elements, indexed from 0 to n-1....
Showing results 1 to 40 of 103

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:04 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC