- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: Q1: Alternative 1 Q2: If the function X returns an integer, uses standard calling convention (and possibly is not dynamically linked, I'm not sure about the actual meaning of __declarespec(import)). Q3: .obj is most oftenly compiled code, all functions and variables from a compiled source file. .lib I think contains … | |
Re: And the number one rules of optimization is??? DO NOT (Atleast not untill you _know_ you need to, and then only where you _know_ it will make a difference, eg profiling). On a side not I recently tried some wtl and they have a rather nifty technique for avoiding virtual … | |
Re: Another reply solue due to the fact that goole desktop for some reason wants to propagate these questions now and then... I wanna say RTFM, but I can include the escape the escape hint... Use \\ for a literar \ in C/C++/Java/(Just about any other application that uses \ escapes … | |
Re: Sugestion: Use regex, produces just about the fastest searches possible (you need a external library thought, I doubt it comes included in vc++ atleast I havent seen it, boost.org is one good source). | |
| |
Re: [inlinecode] m(x) = x < 3 ? 0 : m(x - 1) + m(x - 3) + 1 [/inlinecode] | |
Re: What is wrong with using the functions you already got [code] void Sequence::move(int from, int to) { SeqItemType item = find( from )->item ; remove(from) ; insert( to, item ) ; } [/code] | |
Re: Well here is as modern as you are like to get, and all free [url]http://msdn.microsoft.com/vstudio/express/visualc/default.aspx[/url] | |
Re: Template arguments are <class _Value, class _HashFcn, class _EqualKey, ... > You probably only need to redifine _HashFcn thought... [code] struct newHashFnc { size_t operator(const Point3D &p3d) { return p3d.x << 16 | p3d.y << 8 | p3d.z ; // or any other mixing you'd like } } ; ... … | |
Re: Because you dont release the memory ? (There is no delete matching the new)... (However most implementations of delete would not actually return the memory to the system anyway, it would just put it in the local free lists)... *Edit) If you wanted to allocate lots of memory and be … | |
Re: Try reading up on quicksort in general... The loop (lines 2-9) make sure that all the low values are in one range and the high values in the other... The recursive calls (lines 10,11) then does the same for these fixed subsections, untill the trivial case of one or two … | |
Re: switch only operate on a single integer value... however since a char is smaller than an integer I suppose you could stack it in one value and then do the switch [code] value = ((value << 8) & 0xff) |file.getch() ; switch( value ) { case ('j' << 8 | … | |
Re: Aha... implicit function declarations ! Rather weak thought, but it feels the same as saying something that can not be done in c but in c++, both are complete turing machines and can as such do everything a turing machine can (I heard somewhere that the template language in c++ … | |
Re: 1) Just work your self out from the middle, if they are given in k&r they describe them in k&r ? [inlinecode]char(* (*f())[]) ()[/inlinecode] [inlinecode]*f()[/inlinecode] => f is function pointer taking zero arguments returning [inlinecode](* ... [])() [/inlinecode] => returning array of pointer to functions returning [inlinecode]char ... [/inlinecode] => … | |
Re: IANAAP (I Am Not An Assember Programmer) but, some thoughts: Feels like there is as many ways to write assembler as there are assemblers thought... What is the problem ? Argh, whats up with the k variable in the c++ example (not declared) ? and counting goes in different directions … | |
Re: Well you got a strange compiler, mine outputs hello, hi... the constArray[0] points to the static string "hello", if you want to point at the pointer pointing to hello you gotta do &p... allocating a new char is just a memory leak since the pointer gets overwritten in the next … | |
Re: Suggestion, use qsort of stdlib.h (I think)... you only need to write the compare function and specify the struct size. | |
Re: Saying perhaps it is and the can, but me does not understand (courtesy of our favorite translator babelfish)... | |
Re: Well my first hunch was no ofcourse there would be no difference calling how you call a static member function, the class / object would only be used by the compiler to mangle the name... Thought I usually ask my compiler for help, a test program says more than a … | |
Re: Well the only book I read is Introduction to Data Compression, it contains a couple of chapters on Text compression... However this is mainly theoretical, and probably more use for understanding than fast implementation (I dont think I saw even any pseudo code in there)... But it might be a … | |
Re: These things are more easily done using yacc and bison... I have a vague recollection about some statements of implementability of these types of grammar on a stack based machine so I suppose it should be possible... You probably want to save full tokens on the stack instead of just … | |
Re: I have been stuck in your corner for quite a while, guess I ran out of time... I also recommend that first book since it will tell you what all those classes in MFC does, really... (Saw an example here a while ago... the MFC way was CMenu *cMenu = … | |
Re: [inlinecode]man[/inlinecode] is your saviour, do [inlinecode]man qsort[/inlinecode] or get your libc.hlp from devcpp if you are on win... for a struct of type [code] struct tuple { char artist[50]; char album[50]; char label[50]; int year[4]; char type[30]; } array[ MAX_NUM ], *sorted_array[ MAX_NUM ] ; [/code] a view sorted by … | |
Re: A somewhat odd introduction to ruby... (an interpreted language, with features comparable to python, or so I've heard). [url]http://poignantguide.net/ruby/[/url] | |
Re: Short note, since you seem to have io well in hand just do [inlinecode]man fopen[/inlinecode] and you will have what you need... (You can use the same functions for files as for standard input/output if you have a FILE* pointer)... | |
Re: [code] bool Siblinb::operator<( const Sibling &other ) { return age < other.age ; } ... #include <algorithm> ... std::sort( siblingobj, siblingobj + num_siblings ) ; ... [/code] | |
Re: Lol, so now I'm not an expert on linux utilities but I enjoy tinkering with it now and then... This is one way to solve _this_ problem, somehow I thought it would be possible to use the -k flag for start of key value for sort (btw this is not … | |
Re: damn it I wanted to delte this post... but since it wont do try some simple variation of dfs or bfs just counting the steps taken... | |
Re: [QUOTE=DotNetUser]That's correct. If I have a global function in main that is "SendMessage" to socket, will I be able to call it from a class? My instance of the GUI class is not allowed to be global. How would I get around this? My callbacks needs to use some functions … | |
Re: Hmm, a tricky question (well it took some time to figure out what you are doing anyway)... It looks as thought you dont save the recursive result anywhere so that even if you get a match somewhere in the recursion you will only report a match if you get a … |