Search Results

Showing results 1 to 15 of 15
Search took 0.02 seconds.
Search: Posts Made By: Ptolemy ; Forum: C++ and child forums
Forum: C++ Oct 25th, 2007
Replies: 11
Views: 2,626
Posted By Ptolemy
If you understood the problem well enough to actually write this program, you wouldn't need to ask what language is best. I'll go out on a limb and say you're in over your head at present.
Forum: C++ Oct 25th, 2007
Replies: 40
Solved: c++ scores
Views: 3,190
Posted By Ptolemy
Oh, don't read it as me bashing your solution, it's the same one I'd use. I was just mentioning that little pitfall because I'd noticed it while brainstorming. :)
Forum: C++ Oct 25th, 2007
Replies: 13
Solved: xor linked list
Views: 2,970
Posted By Ptolemy
>but don't know how to use cast. can you help me?
That's something that any C++ book or reference will tell you how to use. It would be "cast" or "type cast" in the index.
Forum: C++ Oct 25th, 2007
Replies: 40
Solved: c++ scores
Views: 3,190
Posted By Ptolemy
>Once you have a student answer string you compare each element
>of that string with each element of the correct answer string
But from the sample file it looks like if the last N answers were...
Forum: C++ Oct 25th, 2007
Replies: 13
Solved: xor linked list
Views: 2,970
Posted By Ptolemy
>i found something but it has an error :"xor1001.cpp
>invalid conversion from `void*' to `link*' ".
You're compiling C as C++. C++ doesn't support implicit pointer conversions to and from void*....
Forum: C++ Oct 25th, 2007
Replies: 13
Solved: xor linked list
Views: 2,970
Posted By Ptolemy
>Doing a linked list using XOR ... I'm not certain what you mean.
It's a hack to avoid wasting extra space on links. It takes advantage of the butterfly effect using XOR. If you take the XOR of two...
Forum: C++ Oct 25th, 2007
Replies: 12
Solved: fibonacci
Views: 4,710
Posted By Ptolemy
>so changing the array to static solved everything.
No, changing the array to static and actually using the values you've cached solved everything. If you don't to the latter, your code won't be any...
Forum: C++ Oct 25th, 2007
Replies: 40
Solved: c++ scores
Views: 3,190
Posted By Ptolemy
>...Now where do i even begin?
You could use everything you've learned in your previous threads that do something similar.

>how do i store them so that the other lines are compared to it for the...
Forum: C++ Oct 25th, 2007
Replies: 12
Solved: fibonacci
Views: 4,710
Posted By Ptolemy
>And remember, the C++ standard includes the C standard, more or less.
Standard C++ currently maintains compatibility with C89, not C99. So you can't use VLAs in C++

>Is my program the best it...
Forum: C++ Oct 24th, 2007
Replies: 12
Solved: fibonacci
Views: 4,710
Posted By Ptolemy
>What about a purely iterative solution, that does not need the excess
>memory, and is not logically limited in the number of values to display?
That's fine for just printing the sequence. The...
Forum: C++ Oct 22nd, 2007
Replies: 2
Views: 2,870
Posted By Ptolemy
You can use the standard time library to do it, sort of:

#include <ctime>
#include <iostream>

void long_running_operation()
{
for ( unsigned i = 1; i != 0; i++ )
;
}
Forum: C++ Oct 22nd, 2007
Replies: 3
Views: 3,513
Posted By Ptolemy
>.533 microns converted to miles per hour = 3.311908
>.674 microns converted to miles per hour = 4.188042
Well, first, you need to remove the "per hour" part of that. The conversion is strictly...
Forum: C++ Oct 19th, 2007
Replies: 14
Views: 2,986
Posted By Ptolemy
That's not a good description of the algorithm. :( You want to loop as long as larger is greater than zero. You want to always double smaller and halve larger, and only add smaller to the accumulator...
Forum: C++ Oct 19th, 2007
Replies: 14
Views: 2,986
Posted By Ptolemy
That's a logic error. What is "Brown's method" supposed to be doing?
Forum: C++ Oct 19th, 2007
Replies: 14
Views: 2,986
Posted By Ptolemy
>As of now, the program only prints out :"Go again?".
It shouldn't print anything. That code won't compile because the braces are mismatched and functions don't nest inside of each other. This works...
Showing results 1 to 15 of 15

 


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

©2003 - 2009 DaniWeb® LLC