Search Results

Showing results 1 to 22 of 22
Search took 0.00 seconds.
Search: Posts Made By: GDICommander ; Forum: C++ and child forums
Forum: C++ Sep 1st, 2009
Replies: 9
Views: 381
Posted By GDICommander
If you are using UNIX, you can use valgrind to check for memory leaks. You need to add --tool=memcheck on the command line to check for leaks.
Forum: C++ Aug 30th, 2009
Replies: 11
Views: 573
Posted By GDICommander
Looks good, but there is a piece of code I would like to show you:

if(is_door_opened==true)

You can simplify this conditionnal expression with:

if (IsDoorOpened())

and make this method...
Forum: C++ Aug 30th, 2009
Replies: 5
Views: 389
Posted By GDICommander
I did a mistake in my last post: the >> operator reads data until a end-of-line character OR a whitespace is found.
Forum: C++ Aug 30th, 2009
Replies: 5
Views: 389
Posted By GDICommander
Are you sure that the file denoted with the name you provided exists?

I'm pretty sure that the answer is yes, but do you really have gSize vertices in your file? Do you really have a line at each...
Forum: C++ Apr 5th, 2009
Replies: 10
Views: 493
Posted By GDICommander
Have you created a new project or have you just opened the file? Opening the file only prevents you from building the executable. You must create a project.
Forum: C++ Apr 5th, 2009
Replies: 10
Views: 493
Posted By GDICommander
See this address for the express edition, I recommend it instead of VC++ 6.0:

http://www.microsoft.com/Express/
Forum: C++ Apr 5th, 2009
Replies: 10
Views: 493
Posted By GDICommander
Maybe you have a specific setting, a flag or something. Check this page:

http://social.microsoft.com/Forums/en-US/vcgeneral/thread/d2677732-d756-42e5-b2f1-5b040819c037

Don't forget that a...
Forum: C++ Apr 5th, 2009
Replies: 10
Views: 493
Posted By GDICommander
Do you have a 64-bit machine?

Have you tried to restart Visual Studio and build again your solution?

Also, I know that a "Clean Solution / Rebuild Solution" solves a lot of problems.

You can...
Forum: C++ Apr 4th, 2009
Replies: 6
Views: 356
Posted By GDICommander
Don't forget to make the thread as solved.
Forum: C++ Apr 4th, 2009
Replies: 6
Views: 356
Posted By GDICommander
According to cplusplus.com (http://www.cplusplus.com/reference/string/string/append.html) ...

string& append ( size_t n, char c );
Appends a string formed by the repetition n times of...
Forum: C++ Apr 4th, 2009
Replies: 6
Views: 356
Posted By GDICommander
About my last post, I have realized that operator[] returns a const char& and not a const char* that will have be used to construct a string.

Instead of using peek, you can use conditions, like...
Forum: C++ Apr 4th, 2009
Replies: 6
Views: 356
Posted By GDICommander
Ok, first, it is very ugly to do:


string(change.begin() +i,change.begin() +i+1)


Instead, do this:


change[i]
Forum: C++ Mar 2nd, 2009
Replies: 18
Solved: PLS. READ
Views: 682
Posted By GDICommander
You should put the numbers at some place... and check every one of them...

That is an extremely easy solution.
Forum: C++ Feb 23rd, 2009
Replies: 12
Views: 1,210
Posted By GDICommander
Creating a recursive function that returns the factorial will solve this problem.

if 0, then return 1
if 1, then return 1
else do n * fact (n - 1)

This is not a tail-recursive version (sorry...
Forum: C++ Feb 23rd, 2009
Replies: 12
Views: 1,210
Posted By GDICommander
What I call a function is something that is not inside a int main(). If you do it with a int factorial() function, you will be able to use it more easily in an another program than a int main().
...
Forum: C++ Feb 23rd, 2009
Replies: 12
Views: 1,210
Posted By GDICommander
I will suggest you this:

Write a function that takes an integer and returns its factorial. (Use the power of recursion)

Test it (IMPORTANT!) and after, call it in your program. That will simply...
Forum: C++ Feb 23rd, 2009
Replies: 12
Views: 1,210
Posted By GDICommander
So, it is a math problem. Go there:

http://en.wikipedia.org/wiki/Poisson_distribution
Forum: C++ Feb 23rd, 2009
Replies: 12
Views: 1,210
Posted By GDICommander
First, indent your code. It is more readable in that way.

Second, how will you find the answer with a pencil and a paper? Answering this question will lead to the structure of your program....
Forum: C++ Feb 23rd, 2009
Replies: 2
Views: 320
Posted By GDICommander
This is not a C++ question. Just think about how you will represent it and if you have problems with C++, your post will be more likely to be solved.

For the update, do a search on the Observer...
Forum: C++ Feb 10th, 2009
Replies: 2
Solved: Error
Views: 246
Posted By GDICommander
Check if you are accessing memory that you have not allocated. Are you using an invalid pointer? Are you using pointers?

Are you referencing an iterator on the end of a vector? (ex: it.end())
...
Forum: C++ Jan 29th, 2009
Replies: 9
Views: 455
Posted By GDICommander
By the way, try indenting your code like this:

int main()
{
}

or

int main(){
}
Forum: C++ Jan 29th, 2009
Replies: 9
Views: 455
Posted By GDICommander
I don't see brackets surronding the parralelIterative function. If this explains the error, it will be good. Also, a semi-colon after the parralelIterative line is not correct.
Showing results 1 to 22 of 22

 


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

©2003 - 2009 DaniWeb® LLC