1,296 Posted Topics
Re: See also [url]http://www.artima.com/intv/goldilocks2.html[/url] | |
Re: Stop indulge in fantasies. See iamthwee's exhaustive answer... | |
Re: Regrettably you did not pay attention to the class Apointer in my post in your previous thread on this topic: [url]http://www.daniweb.com/forums/thread144299.html[/url] The point is that you have a priority_queue<Alumnos*> now, not priority_queue<Alumnos>. So queue ordering (priority) is defined by operator>() for pointers to Alumnos, not by Alumnos::operator>(). But pointer values … | |
Re: If the tree is empty the insertNodeHelper must change its parameter value - the root pointer (see the 1st if alternative). You need pass a pointer to the root pointer (or reference but it's another song), not only its value. The root pointer type is TreeNode<NODETYPE>*. So parameter type must … | |
Re: What's a wonderful old-fashioned Fortran-like code on C++ Forum! ;) 1. [icode]int main()[/icode] - don't write main() only. 2. You declare local variables x, y in the main body, so you can't access x, y arrays from outer scope (in C++ you can with :: qualifier but it's another story). … | |
Re: Why you want to reset system clock? Keep it simpler: [code=cplusplus] clock_t t0, t1; t0 = clock(); // do this... t0 = clock() - t0; t1 = clock(); // do that... t1 = clock() - t1; // Now print t0, t1 and what else... [/code] So your original timing was … | |
Re: Of course, atoi() converts the leading zero for you. Skip "0x" then use strtol() function. It's so easy... | |
![]() | Re: Do you think that this converter is an one-screen-page program? ![]() |
Re: Obviously, you can't establish peer-to-peer connection between independent client processes from your server application. | |
Re: What is it: a linked binary min heap? Why linked? Why binary? Why min?.. | |
Re: Obviously you know that XML per se is not a data exchange protocol. Well-known advatage of XML is a platform independence. However XML (markup only language) does not define data serialization/deserialization rules. So "using XML files in order to exchange informations between different processes" is not a complete solution for … | |
Re: There is a simple solution in that case: [code=cplusplus] const int N = 100; const double eps = 1e-16; // 1 + 1/1! + 1/2! + 1/3! + .....1/n! void Eseries() { double y = 1.0; double f = 1.0; double x = 1.0; for (int i = 0; i … | |
Re: It seems the most interesting question is: why queue?.. | |
Re: I don't know why your compiler gives the error (what's a compiler are you using? ). My VC++ 2008 compiles your source OK. In actual fact std::priority_queue::top() returns non-constant reference, so your original stmt#66 is OK. Another problem: where is desired polymorphism? Alas, when you declare priority_queue<alumnos>, only alumnos part … | |
Re: You can't obtain a reference to bit-field in C++: [quote]A non-const reference shall not be bound to a bit-field (8.5.3). Note: if the initializer for a reference of type const T& is an lvalue that refers to a bit-field, the reference is bound to a temporary initialized to hold the … | |
Re: Well, there is nothing for it. Now you must implement strstr() RTL function. What's an avalanche... Why "ERROR: The find and replace strings are of different length"? Why so truncated replace? It looks like a castrated tomcat... What's is_partial_match role? | |
Re: You forget to copy zero char terminated C string. Can't resist a temptation: [code=c] char* StrCpy(char* pd, const char* ps) { char* p = pd; while ((*p++=*ps++) != 0); return pd; } [/code] It's a classic self-made strcpy... | |
Re: Think before drink. Take a pencil and a sheet of paper, verify your search algorithm(es). Yes, I know the answer but it's your assignment, not mine... | |
Re: Yes, it's a severe blow for all C++-lovers... And your question is... | |
Re: [quote]how to make multiple operation in one execution... convert the operation like "1.22*3+2.1" into string... how to exract the value out to determine the result of the calculation?[/quote] What does this abracadabra stand for? | |
Re: Yet another way to go from A to B: 1. Dress, provide with boots. 2. Make a step. 3. Undress, take your shoes off 4. OK, ready to go from A' to B 5. Is A' == B? 6. No: see #1 ... The same algorithm. What's a wonderful example … | |
Re: Some addition. The char type may be signed or unsigned in C++ (it's an implementation-defined issue). If char is unsigned, the code [icode]if (ch > 0)[/icode] does not work (all chars >= 0). Portable way (one of) to do it: [code] if ((ch & ~0177) == 0) { ... // … | |
| |
Re: 1. [icode]the c++ way of doing things != trying to avoid pointers, and use refs instead[/icode] It's Java and C# ways of doing things ;). 2. Another common approach to defer an object initialization: add init member function to your class. Declare empty objects then allocate memory with init function … | |
Re: I think it's a question for MySQL forums. As far as I know there are lots of info about MySQL building from sources. The question (and the answer) has no relation to the C++ language per se. | |
Re: Try Ultimate++ RAD suite (a very goos IDE TheIDE bundled with MinGW compiler). It's integrated with SDL game graphic library (download it separately), examples included. [url]http://www.ultimatepp.org/[/url] | |
Re: Replace this idiotic [icode]void main()[/icode] to the standard [icode]int main()[/icode], add the last statement in the main: [icode]return 0;[/icode] then try again... | |
Re: It seems the cause of your problem is bad pointers (for example, these Texts objects are deleted before). In any case we need more wide context to help you. Apropos, delete null pointer is a valid operation (do nothing). | |
Re: Add error checking then try again (probably fopen failed): [code=c] fp = fopen(...); if (!fp) { /* Can't open ...*/ } .... if (fscanf(fp,"%d %d %lf",...) != 3) { /* Bad line... */ } [/code] Are you sure you wanted [icode]pop[0][0][k][/icode]? May be [icode][i][j][k][/icode]?.. | |
Re: You are on the C Language forum. The next door: [url]http://www.daniweb.com/forums/forum8.html[/url] | |
Re: I don't know the answer but may be these links help you: [url]http://www.nabble.com/Linking-errors-with-Mingw-and-Gecko-cygwin-mscv-SDKs-td1356421.html[/url] [url]http://www.geocities.com/yongweiwu/stdcall.htm[/url] It seems you need Gecko gcc build... | |
Re: [quote]Well I am sure that my code is right.[/quote] It's nice to hear that about the program which you can't compile w/o errors ;)... Now look at the class BSTree (refactored) interface: [code=cplusplus] class BSTree { public: BSTree(); /* Not implemented yet: void print_inorder(); void print_postorder(); void print_preorder(); */ void … | |
Re: Some remarks about terminology. The C++ Standard use clauses "variable parameter list" and "function that can be called with varying number and types of arguments" for functions with ellipsis in parameter list. As usually authors on this forum use a rather strange term "function with indefinite arguments". Is it OK? | |
Re: 1. Please, use code tag for your snippet: [noparse][code=c] your snippet here [/code][/noparse] 2. Serious (and classic) mistake: [code=c] int grid[30][30]={0},x,j,i,die; ... tempx = rand() % 30 + 1; /* in 1..30 range */ tempy = rand() % 30 + 1; ... grid[tempx][tempy]=data_points; /* must be in 0..29 range */ … | |
Re: [icode]for (;;)[/icode] { Too many factors pro et contra. It depends on control processes architecture. As usually, multi-core CPUs can't run concurent heavy-floating-point-calcs processes or threads effectively. Distributed computing has its own syhch overheads. Number of data transmission channels... } | |
Re: The C++ Standard (9.4.2,2) allows to specify constant-initializer for const integral or const enumeration static data members only. The type double is not an integral type. | |
Re: Allow me reformulate two well-known axioms: 1. COM is a LANGUAGE-NEUTRAL specification "of implementing objects that can be used in environments different from the one they were created in, even across machine boundaries" (Wikipedia). 2. The vtbl (or vtable) concept Is NOT a part of the C++ language specification. It's … | |
Re: I don't understand your question: what's a function? Why and where "assign a pointer to a member in a structure"? It seems this program face is familiar ;). If you want to compute a student grade, pass a pointer to a student structure: [code=c] /* I hate struct name typenames … | |
Re: 1. Yes for a very good optimizing compiler. There are lots of non-performance advantages to do that. 2. As usually, no. Moreover, you have a good chance to get non-reenterable code then forget multi-threading and other acceleration methods. 3. See #1. 4. As usually, the virtual function call includes additional … | |
Re: It depends on OS. No the C language specifications. For Windows see: [url]http://forums.msdn.microsoft.com/en-US/vclanguage/thread/79b89629-765f-4e9a-9bfb-f99226ef8821/[/url] Unix: [url]http://www.in-ulm.de/~mascheck/various/argmax/[/url] | |
Re: 1. Please, use code tag to present your snippets. It's a nightmare to read sources with so horrible indentations w/o code tag... 2. In C a function name implicitly converted to a pointer to this function so you may simply write a function name in this position. 3. As far … | |
Re: There is [icode]double fmod(double,double)[/icode] function in <math.h> header. It calculates so called floating-point remainder of its arguments. At first sight it's a true equivalent of the operator % defined only for integral types arguments. In actual fact a floating-point remainder is not so well-defined function as a modulo operator for … | |
Re: Now your grade in C++ language is Z... Better take your text-book and read about function definition syntax. When you write a valid main function header, come again... | |
Re: It seems you have never seen such basic C++ construct as an array. Please, take your text-book on programming then search and study "An array" part. After that you will never write functions with v1, v2, v3, v4 and so on parameters. Moreover, you will never invent the only global … | |
Re: At first ask the Linux cluster system administrator which of programming tools are installed and in use... | |
Re: Some additions. Try to search Google: "fast string search". There are lots of very interesting links on this topic, for example: [url]http://ei.cs.vt.edu/~cs5604/f95/cs5604cnSS/Algs.html[/url] [url]http://www.concentric.net/~Ttwang/tech/stringscan.htm[/url] See also [url]http://www.arstdesign.com/articles/fastsearch.html[/url] Can you accept battle for the fastest strstr implementaion ;)?.. | |
Re: [quote]I can't seem to find any on google.[/quote] Search for "numerical library C C++" - lots of links. For example: [url]http://www.oonumerics.org/oon/[/url] What's an accurate and complete request for help: [quote]very awkward to work with[/quote] | |
Re: I don't understand what you initialize() function initialized. For example, why the 1st parameter is unused ifstream soda... Look at the snippet below. You may adapt it for your needs... [code=cplusplus] /* Includes (if compiled w/o stdafx.h): #include <stdio.h> #include <limits.h> #include <iostream> #include <fstream> #include <string> */ using namespace … | |
Re: Well, and your question is... ??? | |
Re: Honestly speaking it looks like an absolutely senseless text written in unknown language. May be better you present your assignment?.. |
The End.