1,296 Posted Topics

Member Avatar for mostermand
Member Avatar for mostermand
0
319
Member Avatar for Nemoticchigga
Member Avatar for ArkM
0
118
Member Avatar for castrohe

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 …

Member Avatar for ArkM
0
113
Member Avatar for Emerald214

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 …

Member Avatar for ArkM
0
116
Member Avatar for sauna

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). …

Member Avatar for ArkM
0
110
Member Avatar for skatamatic

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 …

Member Avatar for skatamatic
0
3K
Member Avatar for asifjavaid

Of course, atoi() converts the leading zero for you. Skip "0x" then use strtol() function. It's so easy...

Member Avatar for Narue
0
4K
Member Avatar for iamthwee
Member Avatar for iamthwee
0
261
Member Avatar for Hannahlv

Obviously, you can't establish peer-to-peer connection between independent client processes from your server application.

Member Avatar for ArkM
0
116
Member Avatar for AutoC

What is it: a linked binary min heap? Why linked? Why binary? Why min?..

Member Avatar for ArkM
0
117
Member Avatar for Spartan552

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 …

Member Avatar for ArkM
0
82
Member Avatar for sunveer

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 …

Member Avatar for ArkM
0
117
Member Avatar for mksakeesh
Member Avatar for castrohe

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 …

Member Avatar for castrohe
0
9K
Member Avatar for monkey_king

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 …

Member Avatar for ArkM
0
224
Member Avatar for nizbit

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?

Member Avatar for nizbit
0
151
Member Avatar for ingvarorn

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...

Member Avatar for ingvarorn
0
150
Member Avatar for efg

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...

Member Avatar for hiraksarkardg
0
448
Member Avatar for amrith92
Member Avatar for amrith92
0
187
Member Avatar for watercolour

[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?

Member Avatar for watercolour
0
123
Member Avatar for nizbit

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 …

Member Avatar for ArkM
0
132
Member Avatar for Bigboy06

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) { ... // …

Member Avatar for ArkM
0
102
Member Avatar for thetpaing
Member Avatar for thetpaing
0
74
Member Avatar for monkey_king

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 …

Member Avatar for ArkM
0
117
Member Avatar for deepak@

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.

Member Avatar for ArkM
0
121
Member Avatar for urbancalli

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]

Member Avatar for ArkM
0
257
Member Avatar for AndrejM.

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...

Member Avatar for ArkM
0
175
Member Avatar for YaelGD

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).

Member Avatar for YaelGD
0
138
Member Avatar for BioTeq

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]?..

Member Avatar for Narue
0
111
Member Avatar for ambarisha.kn

You are on the C Language forum. The next door: [url]http://www.daniweb.com/forums/forum8.html[/url]

Member Avatar for ArkM
0
212
Member Avatar for ricardonho

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...

Member Avatar for ArkM
0
238
Member Avatar for phillipeharris

[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 …

Member Avatar for phillipeharris
0
126
Member Avatar for Kadence

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?

Member Avatar for Kadence
0
820
Member Avatar for kishore84

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 */ …

Member Avatar for ArkM
0
150
Member Avatar for Duki

[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... }

Member Avatar for Salem
0
276
Member Avatar for chenzhp

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.

Member Avatar for chenzhp
0
207
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
868
Member Avatar for twburkle

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 …

Member Avatar for twburkle
0
137
Member Avatar for monkey_king

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 …

Member Avatar for Narue
0
151
Member Avatar for ithelp

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]

Member Avatar for ArkM
0
151
Member Avatar for rocosd

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 …

Member Avatar for ArkM
0
149
Member Avatar for freelancelote

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 …

Member Avatar for freelancelote
0
146
Member Avatar for PuQimX

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...

Member Avatar for VernonDozier
0
97
Member Avatar for gispe

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 …

Member Avatar for ArkM
0
120
Member Avatar for Ninabox

At first ask the Linux cluster system administrator which of programming tools are installed and in use...

Member Avatar for Ninabox
0
122
Member Avatar for vidit_X

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 ;)?..

Member Avatar for ArkM
0
142
Member Avatar for daviddoria

[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]

Member Avatar for daviddoria
0
155
Member Avatar for slytherfreek

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 …

Member Avatar for slytherfreek
0
114
Member Avatar for LiquidScorpio81
Member Avatar for vijaysoft1

Honestly speaking it looks like an absolutely senseless text written in unknown language. May be better you present your assignment?..

Member Avatar for cikara21
0
97

The End.