Search:
Type: Posts; User: ka3ak
Search:
Search took 0.03 seconds.
-
June 26th, 2008, 02:58 PM
template <size_t s> struct bound;
template <> struct bound<2> { static const unsigned int b = 32767; };
template <> struct bound<4> { static const unsigned int b = 2147483648;...
-
August 17th, 2007, 12:52 PM
before calling rand, call srand(time(NULL)) to seed.
-
August 6th, 2007, 03:51 PM
i am so wrong it's shocking.
-
August 6th, 2007, 12:09 PM
-
August 6th, 2007, 09:26 AM
can't do that. another idea is to switch on the hash value of a string.
-
August 6th, 2007, 09:22 AM
myclass[5] = 7; <- this calls int& operator [](int i);
const int x = myclass[5]; <- this calls const int& operator [](int i) const; (or int operator [](int i) const;)
-
August 3rd, 2007, 07:06 AM
could you post your code to get a clearer picture of the problem. thanks!
-
August 3rd, 2007, 06:50 AM
this is about as clear as it gets my friend: (http://en.wikipedia.org/wiki/Insertion_sort)
-
August 2nd, 2007, 09:00 PM
holy <explative deleted>, that's long! if it works, it works man. bfs = breadth first search (http://en.wikipedia.org/wiki/Breadth-first_search)
-
August 2nd, 2007, 07:53 AM
how about something like this:
template <typename T>
struct vector_builder
{
vector<T> m_vec;
vector_builder() {}
vector_builder(const T& c) : m_vec(1)
-
August 2nd, 2007, 06:56 AM
put this both places where you include your c-library. this is by no means elegant, but it'll work.
#if !defined(_include_once_)
# include "c-library.h"
# define _include_once_
#endif
-
August 1st, 2007, 08:43 PM
try compiling and running in debug, it might point you to the exact line where the error occurs. (press f5 if you're using VS)
-
August 1st, 2007, 08:37 PM
taking the "s -> A, D, G" statement alone. i'm going to assume it means s is adjacent to A, D, and G - so outdegree of 3, and A, D, and G have indegree of 1 each. so take it one step at a time - if...
-
August 1st, 2007, 08:20 PM
the second case isn't ambiguous because you're not passing in a const int. the first case is a little trickier. when you pass by const value (func(const int i)), the const is applied to the copy of...
-
August 1st, 2007, 07:58 PM
while( i; i != sizeof(out); ++i ){
you probably meant to use a for loop.
-
August 1st, 2007, 03:06 PM
i think it is referred to as "the most vexing parse problem", might be worth checking it out. (http://www.gotw.ca/gotw/001.htm)
-
July 31st, 2007, 08:26 PM
you can call pthread_join(...) to wait for the threads to finish before destroying the mutex. (http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_join.html)
-
July 31st, 2007, 02:44 PM
oh, i'm sorry, i read that as finite. your solution is the right one
-
July 31st, 2007, 12:08 PM
there's no need to do the first step, implement a comparison operator where +infinity is always greater than any number and do a bin search on the whole array.
lets say the array is all ints and...
-
July 31st, 2007, 09:45 AM
you were trying to call ->image on the pointer to Piece*. if you made the array of Piece objects, the iterator would be a pointer to one of the objects, so you could use -> operator. the way you did...
-
July 31st, 2007, 09:13 AM
an iterator is more or less a pointer, in your case it's a pointer to a Piece* (pointer to a pointer), so you need to dereference it to get to the actual Piece*, then you can use the -> operator.
-
July 30th, 2007, 09:58 PM
and this is why i didn't disagree with you, but there are, although few, several cases :thumb:
-
July 30th, 2007, 09:56 PM
and this:
class X
{
int a;
int b;
-
July 30th, 2007, 09:50 PM
no rolls royce can go through rough sand/mud/rocks/water. an 80s Toyota FJ or Land Cruiser can though. pick the right tool for the right job.
-
July 30th, 2007, 09:47 PM
and all this time i thought it was a personal preference thing, hmmmm :blush:
|
Click Here to Expand Forum to Full Width
|