Search Results

Showing results 1 to 20 of 20
Search took 0.01 seconds.
Search: Posts Made By: JasonHippy ; Forum: C++ and child forums
Forum: C++ 2 Days Ago
Replies: 7
Views: 192
Posted By JasonHippy
Despite working as a programmer for several years, I wouldn't consider myself an expert per se. I'm still learning new things every day. But I'd have to echo what niek_e said and say that the main...
Forum: C++ 3 Days Ago
Replies: 3
Solved: a code an error
Views: 118
Posted By JasonHippy
Your GetData and GetSize functions need to be declared const
e.g.

unsigned GetSize() const // This
{
return n;
}
Forum: C++ 25 Days Ago
Replies: 7
Views: 266
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++ 27 Days Ago
Replies: 5
Views: 370
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++ 27 Days Ago
Replies: 5
Views: 370
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++ 31 Days Ago
Replies: 11
Views: 363
Posted By JasonHippy
Hey Tom.
Looking at the error messages and the fact that some of them are referring to a vector and then looking at line 3 of your final block of code:

std::vector<BaseEnt> entities(;

Note:...
Forum: C++ 33 Days Ago
Replies: 4
Views: 309
Posted By JasonHippy
OK well, to clear things up we'll take a quick look at how different parameter passing methods affect the way that parameters to functions are handled inside functions.

There are three main ways...
Forum: C++ 33 Days Ago
Replies: 4
Views: 309
Posted By JasonHippy
OK, I'm not sure exactly what you're after here but this snippet might help you a little:

#include<iostream>
#include<fstream>
#include<string>
#include<vector>

using namespace std;
...
Forum: C++ Oct 29th, 2009
Replies: 7
Views: 260
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 16th, 2009
Replies: 7
Views: 403
Posted By JasonHippy
Another thing that was pointed out by one of my math-geek colleagues was that my algorithm would also incorrectly flag 1 as prime.

Now I always thought that 1 was prime (it only divides evenly by...
Forum: C++ Oct 9th, 2009
Replies: 18
Views: 986
Posted By JasonHippy
OK, push_back definitely is the safest way of populating a vector. However, the method I'm about to show is not particularly good practice, but it can be done and it does have it's uses:
...
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 7th, 2009
Replies: 20
Views: 448
Posted By JasonHippy
To put dkalitas point a little more succinctly:
If you want to execute several statements under an if() statement, then you should enclose them with curly braces '{}'.
e.g.
if(condition)
{
...
Forum: C++ Sep 16th, 2009
Replies: 5
Views: 386
Posted By JasonHippy
Considering the problem you have set, your algorithm is completely wrong. And as already mentioned by niek_e, you're using the for loop incorrectly too!

Follow niek_e's advice and take a good look...
Forum: C++ Sep 14th, 2009
Replies: 4
Views: 201
Posted By JasonHippy
In main() you aren't instantiating your matrix class correctly.
Also your add and multiply functions are currently member functions so you'd have to access them via an instance of your Matrix...
Forum: C++ Aug 19th, 2009
Replies: 10
Views: 442
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 7th, 2009
Replies: 4
Views: 303
Posted By JasonHippy
One other thing has sprung to mind....

If your program is actually running for a while before it bombs out, it's almost certainly a bug in your code.

If it works on your machine and not any...
Forum: C++ Jun 4th, 2009
Replies: 4
Views: 401
Posted By JasonHippy
I seem to recall having similar issues at my previous job, I had some software to maintain in VC6 which threw up several errors when I first tried to compile the source, despite having paths set up...
Forum: C++ Apr 30th, 2009
Replies: 2
Views: 275
Posted By JasonHippy
Nice post sky, well explained...
But I noticed a very very minor mistake here....



3*26=78, not 76.
So the final value of x is:
x = 78+5-30
x= 83 - 30 = 53 (as reported by the OP!)
Forum: C++ Jan 7th, 2009
Replies: 1
Views: 419
Posted By JasonHippy
I'm not sure exactly what you're asking when you say
"can you tell me which style below function is showing in C++"

But I can answer the question in the topic title
"what is going on in this...
Showing results 1 to 20 of 20

 


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

©2003 - 2009 DaniWeb® LLC