Search Results

Showing results 1 to 40 of 40
Search took 0.01 seconds.
Search: Posts Made By: JasonHippy ; Forum: C++ and child forums
Forum: C++ 1 Day Ago
Replies: 3
Solved: a code an error
Views: 89
Posted By JasonHippy
Your GetData and GetSize functions need to be declared const
e.g.

unsigned GetSize() const // This
{
return n;
}
Forum: C++ 4 Days Ago
Replies: 4
Views: 159
Posted By JasonHippy
Take a look at this page:
http://msdn.microsoft.com/en-us/library/b9skfh7s.aspx

Assuming that the other processes you mentioned are programs that you've written and as long as I understood the...
Forum: C++ 4 Days Ago
Replies: 9
Views: 257
Posted By JasonHippy
Aha, thanks Narue, that was beginning to bug me!
I've not done anything much with unicode, so I've never come across that particular problem before. But I guess that would make sense!

I shall...
Forum: C++ 4 Days Ago
Replies: 9
Views: 257
Posted By JasonHippy
Hmm, That's very odd!
After looking into this, Niek e's example compiles ok for me and outputs the strings properly.
I'm not sure why you're seeing the addresses of the columns instead of the...
Forum: C++ 4 Days Ago
Replies: 9
Views: 312
Posted By JasonHippy
OK, if you need a fresh pair of eyeballs to go over the code, .zip up all of the source files for your project and post it here as an attachment, I'd be more than happy to take a look at it for you!...
Forum: C++ 5 Days Ago
Replies: 9
Views: 312
Posted By JasonHippy
Hmmm, that's odd. That looks like it should correctly update the objects balance. Have you tried using the this pointer to refer to the balance?
e.g.

this->balance -= amount;

That might just...
Forum: C++ 7 Days Ago
Replies: 9
Views: 312
Posted By JasonHippy
OK, well take another look at your code...
When the Bank::withdraw function is called, a pointer to the relevant account is obtained. If the account balance is >= the amount, then the withdraw...
Forum: C++ 7 Days Ago
Replies: 4
Views: 242
Posted By JasonHippy
Personally I'd copy the sentence into a stringstream object and then use the stringstream's >> operator to separate each word from the sentence and store each word in a vector of strings.
Like this:...
Forum: C++ 21 Days Ago
Replies: 2
Views: 271
Posted By JasonHippy
From looking at the code, it seems to me that if you run your debugger and step through the program you'll find that line 34 will fail to read anything from the input file.

The reason for this is...
Forum: C++ 23 Days Ago
Replies: 7
Views: 271
Posted By JasonHippy
Oh I see you've HAD to implement your own queue class as a part of your assignment...sorry I thought you were just over complicating things for yourself.

In that case, to turn your class into a...
Forum: C++ 23 Days Ago
Replies: 7
Views: 261
Posted By JasonHippy
dkalita has already explained it to you...Try reading his post again!

The function 'fun' returns an int.
But it takes a pointer to a function as a parameter.
The function pointer must point to a...
Forum: C++ 23 Days Ago
Replies: 7
Views: 271
Posted By JasonHippy
It seems to me that you are over complicating things. Wouldn't it be a lot simpler to just use a double ended queue, otherwise known as a deque?
Modifying your code from one of your previous posts...
Forum: C++ 25 Days Ago
Replies: 9
Views: 330
Posted By JasonHippy
You might want to take a look at this thread:
http://www.daniweb.com/forums/thread230230.html

The first few posts are irrelevant, but the later posts are probably more or less exactly what you're...
Forum: C++ 25 Days Ago
Replies: 1
Views: 226
Posted By JasonHippy
It's because the literal value (25.95) that you are passing into your call to the function VAR1 is automatically treated as a double, but your function takes a float as a parameter. So you're getting...
Forum: C++ 25 Days Ago
Replies: 5
Views: 358
Posted By JasonHippy
Aha,
I've just fired up one of my linux boxes, I've created a project in codeblocks using your files. I've made my suggested changes and and tried compiling... And there are still compiler errors....
Forum: C++ 25 Days Ago
Replies: 5
Views: 358
Posted By JasonHippy
One thing that immediately strikes me is that you are using #pragma once, which as far as I am aware is a preprocessor command that is used solely by Microsoft compilers. So perhaps using traditional...
Forum: C++ Oct 30th, 2009
Replies: 5
Views: 218
Posted By JasonHippy
Alternatively, if you only wanted the extra block to be shown if the value of the parameter was 3 then you could change this block from my previous listing:

if(i==myCondition)
{
cout << "i = "...
Forum: C++ Oct 30th, 2009
Replies: 5
Views: 218
Posted By JasonHippy
Then what you need to do is parse the command line and store the relevant arguments in variables and then use those variables to determine what happens in your code.

So perhaps something like...
Forum: C++ Oct 29th, 2009
Replies: 7
Views: 257
Posted By JasonHippy
Aha, I've just quickly tested it and it seems to work!
Here's a little program I knocked up, loosely based around previously posted code in this thread:

#include <iostream>
#include <algorithm>...
Forum: C++ Oct 29th, 2009
Replies: 7
Views: 257
Posted By JasonHippy
I've not actually tried this, but would something like this work for the deq_test function?

bool deq_test(Str& deq1, Str& deq2)
{

if(deq1.a==deq2.a)
{
return(deq1.b<deq2.b);
}
else
Forum: C++ Oct 9th, 2009
Replies: 25
Solved: C++ problem
Views: 588
Posted By JasonHippy
Ah hang on, I see the problem.....I should've spotted this off the bat! heh heh!

#include<iostream>
#include<string>

using namespace std;

class STD1{
int id;
string...
Forum: C++ Oct 9th, 2009
Replies: 4
Views: 348
Posted By JasonHippy
Why don't you try using the shlobj.h function SHGetSpecialFolderPath to get the path to the users My Documents folder? It would save all of the messing about your doing there!

Try replacing the...
Forum: C++ Oct 9th, 2009
Replies: 25
Solved: C++ problem
Views: 588
Posted By JasonHippy
What about this?......

string name = string("");


That should do the trick!

Cheers for now,
Jas.
Forum: C++ Sep 25th, 2009
Replies: 3
Views: 181
Posted By JasonHippy
The description of your problem is at best vague and at worst confusing...Being able to see the code that's actually causing you the problem would help!
So if you could post some code it would help...
Forum: C++ Sep 25th, 2009
Replies: 5
Views: 450
Posted By JasonHippy
What about replacing the backslashes with forward slashes?
So wherever there was a single backslash, replace it with a forward slash. That should also fix your problem!

I know typically in...
Forum: C++ Sep 10th, 2009
Replies: 12
Views: 523
Posted By JasonHippy
Your indentation goes a bit off from line 26 onwards (but that is more of an aesthetic thing which affects the readability of your code, it doesn't affect the code in any other way..The compiler...
Forum: C++ Aug 19th, 2009
Replies: 10
Views: 441
Posted By JasonHippy
What about if you change px from int to long? Does that give you any differemt results?
The thing to take note of here is that px is currently declared as an int. Whereas rect.right and rect.left...
Forum: C++ Aug 11th, 2009
Replies: 22
Views: 892
Posted By JasonHippy
OK, well the error messages say it all...
For starters you need to uncomment the definition of RAND_MAX which is the cause of your error.

Secondly, as Salem has pointed out, you need to include...
Forum: C++ Aug 11th, 2009
Replies: 27
Views: 1,117
Posted By JasonHippy
This concept seems really strange to me...
You've created a class called Mp3 and a class derived from Mp3 called Frame, but the Mp3 class has members which are instances of Frames???

I could be...
Forum: C++ Aug 8th, 2009
Replies: 6
Views: 341
Posted By JasonHippy
Looking briefly at the first block of code, I think it's because the char buffer is declared inside your function and only has scope inside your function. So as soon as your function returns, the...
Forum: C++ Jun 16th, 2009
Replies: 9
Views: 494
Posted By JasonHippy
I second that motion!
That would be preferable to the method I put forward.

I just wasn't sure how familiar the OP was with structs, pointers and arrays. So I went with the simplest example...
Forum: C++ Jun 16th, 2009
Replies: 9
Views: 494
Posted By JasonHippy
As the other guys have suggested, there are several ways around the problem.
The error you're getting is because your F_Ite() function does not return a value.

A function can only return one...
Forum: C++ May 5th, 2009
Replies: 10
Views: 501
Posted By JasonHippy
Doh, good point....I stand corrected madam... {hangs head in shame}
I didn't spot the unnecessary usage of &..Although now you mention it, it's glaringly obvious! {kicking self}

He he, ne'er...
Forum: C++ May 5th, 2009
Replies: 10
Views: 501
Posted By JasonHippy
If the problem is occurring when the program exits, it's probably because you aren't freeing the block of memory you're allocating in your call to malloc......It's one of the golden rules of C and...
Forum: C++ May 5th, 2009
Replies: 4
Views: 474
Posted By JasonHippy
Aha, yes sorry...I was in a bit of a rush on Saturday....I'd started replying to the thread and then my other half started harassing me 'cause she wanted me to drive her into town...In my haste, I...
Forum: C++ May 2nd, 2009
Replies: 4
Views: 474
Posted By JasonHippy
The line:

aa.getAttribute() = Id;

Is where you're going wrong here....
The assignment operator assigns the left hand operand the value of the right operand.

So you are trying to assign the...
Forum: C++ Apr 24th, 2009
Replies: 11
Views: 518
Posted By JasonHippy
Ah, I see niek_e snuck in there with the answer while I was writing my last post!
Forum: C++ Apr 24th, 2009
Replies: 11
Views: 518
Posted By JasonHippy
In windows, by including shlobj.h you can use a call to determine the path to the users desktop using the following:

// This variable will store the path to the users desktop
LPSTR desktopPath =...
Forum: C++ Apr 24th, 2009
Replies: 3
Views: 369
Posted By JasonHippy
Assuming you're using a std::string to hold your filename, I think you just need to convert it to a c style string in your call to ofile.open....
i.e.

ofile.open(file.c_str());


Hope this is...
Forum: C++ Apr 23rd, 2009
Replies: 5
Views: 374
Posted By JasonHippy
The easiest way would be to use the ios::app flag, this will open the file in append mode if the file exists, if it can't find the file, a new one will be created.


ofstream myfile;...
Showing results 1 to 40 of 40

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC