68 Posted Topics

Member Avatar for Peter4n31

What you have there is not a pure virtual function, but just virtual function. A purely virtual function would be like: [icode]CoreExport virtual void EnumAuxFiles(AssetEnumCallback& assetEnum, DWORD flags)=0;[/icode]. A simple virtual function means only one thing: it can be re-defined by it's child classes. There is a good description of …

Member Avatar for Peter4n31
0
372
Member Avatar for rmbrown09

For the file - I second pseudorandom21. If you want, you can use a library for XML. If you want to store the whole thing in the memory - I'd suggest a tree, where every node can have 26 children (one for each alphabet letter) and the node contains the …

Member Avatar for jaskij
0
533
Member Avatar for seanster138
Member Avatar for jaskij
-1
360
Member Avatar for mrsjdoyle73

My guess is that you don't initialize thouse doubles. Or divide by something incredibly close to zero. I can't see the [ICODE]DisplayTotals()[/ICODE] method called in main, so it's hard to say what's actually wrong. Also, it's an old story, but since those are fixed point numbers, store them as integers …

Member Avatar for jaskij
0
113
Member Avatar for MasterGberry

[icode]binaryhash.h line 46[/icode] You need a forward declaration of the struct [icode]node[/icode]. Or just move the private part [icode]before[/icode] the [icode]public[/icode] one. [icode]binaryhash.h line 46[/icode] [icode]void deleteNode(node *n)[/icode] takes a pointer, not a value. [icode]binaryhash.h line 54[/icode] This one I don't really get, probably some spelling mistake or something.

Member Avatar for MasterGberry
1
186
Member Avatar for rmbrown09

The way I see it, you should not change the dirs, just include the files properly. The [icode]#include <>[/icode] directive includes files from the compilers include path. The [icode]#include ""[/icode] directive includes files from the local folder. I hope this clears things up.

Member Avatar for jaskij
0
433
Member Avatar for SoftShock

+1 to WaltP Actually, did you read the error(shouldn't it be a warning?)? It should clearly state the line where this uninitialized variables is used. Other than that, you never set result inside [icode]main()[/icode]

Member Avatar for SoftShock
0
238
Member Avatar for aditdano

It is probably an error in your implementation, I'm not going to look for the particular cause, just list all the things I find (more or less) wrong in your code. 1. Use vectors! 2. Are you aware, that your swap function does NOTHING? Really. It works on local copies. …

Member Avatar for jaskij
0
219
Member Avatar for Odanaga

This is a linker error. The point here is, you are telling the compiler to compile this code as an app, not a library, so it expects int main(), which is nowhere in your code. If this is a school assignment, just adding int main() somewhere below (which you would …

Member Avatar for Odanaga
0
392
Member Avatar for Al Borland

[URL="http://www.daniweb.com/software-development/cpp/threads/70096"]http://www.daniweb.com/software-development/cpp/threads/70096[/URL] My favourite is Bruce Eckel's "Thinking in C++" - it's available free online, just google it. Other than that, use [url]cplusplus.com[/url] or, if you're using MS Visual Studio, the [url=http://msdn.microsoft.com/en-us/library/default.aspx]MSDN Library[/url] might be good for you.

Member Avatar for PrimePackster
0
187
Member Avatar for vyrte

You need some sort of event handling... Don't really know what libs are used under lin.

Member Avatar for WaltP
0
178
Member Avatar for sync101

You could try std::string::find ([url]http://cplusplus.com/reference/string/string/find/[/url]) to find the first closing parenthesis, translate the first part, then go on. So the code would look more or less like this: [CODE=cpp]string toTranslate; getline(cin,toTranslate); int lastPos=0; int size=toTranslate.size(); do{ int pos=toTranslate.find(')',lastPos); string current=toTranslate.substr(lastPos,lastPos-pos); // translate current here lastPos=pos+1; }while(lastPos!=0)[/CODE] Please debug it, as …

Member Avatar for jaskij
0
108
Member Avatar for RavesCoder

Anything more specific? I don't really remember the rules for this part of the board, but isn't it more code-centered? If no, let me just direct you to the LazyFoo tutorial - it covers some basic concepts for both game making and graphics. At least half my year at CS …

Member Avatar for jaskij
0
175
Member Avatar for mikeshadow

Mark me wrong, but a sieve for 8k numbers shouldn't run too long. Why 8k? It's sqrt(64000000) and all divisors are mirrored after square root, ie: Divisors of 28: 1,2,4,7,14,28. You can connect them in pairs: 1-28,2-14,4-7. And guess what? Left and right sides of the pair are parted by …

Member Avatar for mikeshadow
0
506
Member Avatar for prabh94

1. Please don't make such ugly one-liners like lines #14 and #33 2. I don't know, if this helps, but x definitely goes into negatives, which might cause your factorial function to do strange things.

Member Avatar for jaskij
0
461
Member Avatar for jaskij

The program is supposed to compute the values of [URL="http://mathworld.wolfram.com/GammaFunction.html"]Euler's Gamma Function[/URL] using an infinite product (formula #15 in the link), and it does so decently for low values, but the error gets too big for bigger values. Using both Mathematica and Maxima for reference this is what I get …

Member Avatar for jaskij
0
212
Member Avatar for cangan

Globals are EVIL. Period. You have two ways: 1. declare the vector inside main() and pass a pointer (this is more C-way) [code=cpp] void foo(vector<vector<int> >* items){ }; void bar(vector<vector<int> >* items){ }; void foobar(vector<vector<int> >* items){ }; void main(){ vector< vector<int> > items ( 6, vector<int> ( 6 ) …

Member Avatar for cangan
0
125
Member Avatar for triumphost

Line 6 is a special constructor syntax, used if all you want to do in a constructor is assign values. Donno how to explain it much further without copying a longer text on constructors, classes and so on... Second, for that code to work, you have to define the Point …

Member Avatar for triumphost
0
7K

The End.