669 Posted Topics
Re: From what I can see the function in question takes a pointer to a cNPC object, not a pointer to an array of cNPC objects. Would it make more sense to store your cNPC objects in something like a std::vector instead of an array? e.g. std::vector<cNPC> That way you can … | |
Re: I've not used tinyXML++, but I endured the terrible tutorial in Ancient Dragons link a while ago. I was looking at it a few months ago and had a bit of a mini nightmare with it! Whoever wrote that piece posted some badly untested code. I couldn't get it to … | |
Re: Here is my advice: You've come up with an algorithm, so now try translating that to code yourself. Come back here and make another post if you hit any problems with your code. If you do have any problems, remember to be as clear as you can about the nature … | |
Re: What about the fuzzy selection tool, which creates a selection from a colour? Its the tool that looks a bit like a magic wand. Click on the fuzzy select tool, then click on the logo's background area and then tweak the tolerance for the colour (in the fuzzy select tools … | |
Re: I think the reason the OP wanted to install IronPython was probably to have an IDE for python. Obviously, as already stated IronPython is only for windows, so that is out of the question. However there are several other python IDE's available. Idle and SPE (Stani's Python Editor) immediately spring … | |
Re: Hey Tom! You said that this portion of code was causing the runtime error: [CODE] void CEntityController::SpawnEntities( ) { for( int i = 0; i < m_vEntities.size( ); ++i ) m_vEntities[i]->Spawn( ); } [/CODE] Bearing that in mind, have you tried using an iterator to dereference the vector, or perhaps … | |
Re: Here's something I just knocked up in a few minutes....This isn't exactly what you're doing, but it should give you a few ideas to use in your game. My variant uses one tower. The player starts with 50 blocks in their tower. The computer will then draw random cards (valued … | |
Re: [QUOTE=srinath3;1131240] iam unable to get the appropriate out put for this code.I think the problem is with the operator overloading.Could any one come up with solution??[/QUOTE] The main problem I can see is in your operator overload at line 17. The pointer 'temp' is uninitialised, it doesn't point to anything. … | |
Re: Perhaps put a request in to the gEdit developers for a maude highlight plugin? Otherwise, you could make your own, which will involve creating an xml file describing the various rules of the language in /usr/share/gtksourceview-2.0/language-specs/ calling it maude.lang (take a look at a few of the other .lang files … | |
Re: You have a missing semicolon ; at the end of line 2. Cheers for now, Jas. | |
Re: It may make sense to make use of your debugger to try to find the problem here. Try running a debug build from your IDE. When the seg-fault occurs you should be given the opportunity to break out of the program and you'll be shown the line of code that … | |
Re: [QUOTE=trebauchet1986;1128836]I have c++ functions in which all the arguments are integers....I was wondering if there was a way of telling the computer this, other than typing int before each and every variable....I tried function S(int a, b,c..) but did not work....[/QUOTE] Short answer...No, you can't. You have to specify a … | |
![]() | Re: Hmm, this is something that's stumped me recently too. I've been messing around with importing Inkscape .svg's into AS3, but the registration point of the .svg's are always at 0,0 (top left), whereas I usually want the registration point to be at the centre of the graphic. For now, I've … |
Re: The macro functions rotateleft and rotateright perform binary shift operations, shifting the binary value of x by n places in the appropriate direction using the << and >> binary shift operators. So using some smaller, more sensible values for x and n (e.g. x=4 n=2); if we now did something … | |
Re: The entire OO package isn't installed in the standard Ubuntu LiveCD installation. It's missing openoffice.org-base and maybe one or two other bits. Also openoffice formula is hidden in the main menu, but you just have to make the shortcut to it visible in the menus if you want to access … | |
Re: Hmm, this problem sounds interesting... I've just been upgraded to VS2008 Pro, from VS2003 Pro at work and it's been great so far. The ability to see inside std library containers from the debugger without having to add code to log values has been most welcome. VS2003's debugger was a … | |
Re: Basically, he's talking about passing an .xml file from python to a flash application. The OP could take a look at this link: [url]http://www.swaroopch.com/blog/big-brother/[/url] Here, the author has created a python script to monitor a users pc usage, logging the details of time spent in different applications and writing the … | |
Re: One thing in your code struck me almost immediately. In functions.cpp you haven't included functions.h, which is most likely the root cause of your problem! Cheers for now, Jas. [edit] P.s. I think you also need to include stdlib.h for srand, but I could be wrong! | |
Re: Try opening up a python command line, and enter the folowing: help() modules After a short while you should see a list of all installed modules. Does PIL appear anywhere in the list?? If you can't see it, you should try running the PIL installer again. But if it is … | |
Re: Can you include a little bit more detail? Perhaps also some relevant code? If you could at least post the relevant bits from your .h and .cpp file it would be very helpful to actually see things in context and make it easier to diagnose the problem. As it stands … | |
Re: Storing marks in your class as an int rather than a reference to an int would be the simplest way of solving the problem. Once assigned, a reference cannot be re-assigned and that is the cause of your problem here. In your copy constructor, you are creating a copy of … | |
Re: Ah, still working on the ol' engine I see! Looking at the actual error and your code; I think in this instance, forward declaring the entitycontroller class is not working in globals.h. In fact thinking about it logically, forward declaring the class in globals.h isn't really appropriate either. The globals … | |
Re: [QUOTE=vader1231231;1122483] My question is, how does it work? [CODE] if (high_num < random_num) high_num = random_num; if (low_num > random_num) low_num = random_num; [/CODE] [/QUOTE] You did write the code yourself didn't you?? Take a closer look at the code, read it aloud if it helps.. if high num is … | |
Re: [QUOTE=SpyrosMet;1122501]Hello. Can someone tell me what will happen if i have an array Ar[5][5] and a pointer ptr = Ar[0][0] and try accessing the second line of Ar throught ptr by increasing it by 5? I mean ptr+5 ==Ar[1][5] or something else?[/QUOTE] You're almost there. Assuming you had a 5X5 … | |
Re: [QUOTE=Jeronim;1122461]hi! I have created a class with 2 constructors and whenever i try to access it i got the error no match for to call int& here is the code [CODE]class A{ public: A(){}; A(int i); int moj_broj; }; A::A(int i):moj_broj(i){} int main() { A something; cout<<"before "<<something.moj_broj<<endl; something(5); cout<<"after … | |
Re: [QUOTE=Reliable;1121302]Good Afternoon All, I have a template that I'm working on with the same flash header on each page. The header contains the drop down menu to go to the other HTML pages in which the header is placed. I noticed this as one of the parameter lines [CODE]<param name="movie" … ![]() | |
Re: From the looks of the error you're getting, I'd say you probably need to create an override for the operator< to allow two instances of your node class to be compared. I've not really looked through your code too much, I've only given it a brief once over so I'm … | |
Re: How about this?? This will cause the game board to be reset/redrawn when the user selects 'yes'. [CODE] import Tkinter as tk import tkMessageBox from Tkinter import * import sys class BoardGame: under_vals = [ '0', '1', '1', '0', '1', '0', '1', '0', '0', '0', '1', '1', ] disp_vals = … | |
Re: Flash used to be timeline based, but you don't need to use it at all. If you use AS3 you can do things without the timeline. In fact if you download the Flex3 SDK you don't even need to shell out for the Flash IDE either. You can create .as … | |
Re: I've recently been upgraded at work from VS2003 to VS2008 (woo hoo I can finally see inside STL Containers without having to use my own logging class!! :) ). Visual Studio is a great IDE, the debugging features are second to none, VS2008 is definitely my favourite IDE on Windows. … | |
Re: [QUOTE=Roger_Hades;1115374]I think i've have enough of this nonsense of trying to use sort() and crack my head and all... i'm just going with the bubble sort. thanks alot for all your help people :D[/QUOTE] Don't give up now!! Take a look at this thread: [url]http://www.daniweb.com/forums/thread242984.html#post1064721[/url] It should explain all you … | |
Re: Yes it is possible. If you've been having trouble trying to do this, I'm assuming you were doing something like this: [CODE]pResult = p1 + p2[/CODE] Which is definitely [B]not [/B]what you want to do. The compiler probably wouldn't allow it anyway, but what that code would attempt to do … | |
Re: OK, well for starters you don't want a goto in makeEven, you want to return something.... Also in main you'd need to assign the value of x to the value returned by a call to makeEven(x). That gives you this: [CODE]#include <iostream> using namespace std; int makeEven(int x) { if … | |
Re: OK, I'll try to explain this as simply and accurately as I can. First though, a note on functions: All functions must return something...Anything, even if that something is actually nothing (if a function returns nothing then you use the 'void' return type). Return doesn't end the program unless the … | |
Re: Have you tried using ios:: flags on the file open instead of the fstream:: flags? Perhaps try: [CODE] fstream file ("myFile.dat", ios::out | ios::binary | ios::app); [/CODE] Does that make any difference?? Cheers for now, Jas. | |
Re: The whole point of a constructor is to initialise any member variables in your class. If members are not initialised correctly at construction, then you are at risk of inroducing all manner of bugs into your program. So in your example, your default constructor for your mytype class should at … | |
Re: Well you're very nearly there! You said you wanted to find out how many items in the array were greater than 100, that would imply that you need some kind of counter, which is the missing ingredient in your original description. So in your code: You set your counter to … | |
Re: OK, I'm not sure if this is something I've dreamt up during some wierd geeky dream (or nightmare!) or whether I've actually seen something about this subject before. If I have seen this somewhere, for the life of me I can't remember where it was! Anyway, I believe that you … | |
Re: You can't pass the filename like that, that's just passing "args[1]" as a string literal you need to do something like this: [CODE] // build the string.. std::string command = "fc " + (std::string)args[1] + " ../o.txt"; // now execute the command.. code = system(command.c_str()); [/CODE] Now you're good to … | |
Re: Have you tried running your code through a debugger? If you take the call to fabs out of your return statement in your operator== overload and store the result in a variable and then step through your code and take a look at the value, you'll see the problem. Change … | |
Re: Well think about it! Take another look at Narue's example and apply that to your problem... Narue's example uses ints rather than your 'sample' class, but most of the code reflects what you originally posted. All she's got in addition is a compare function, a call to std::sort and a … | |
Re: Hey Tonka! Wouldn't it make more sense to use a structure (struct) to store the name, age and score for each person and then use one array of structures instead of three separate arrays? That way you only have to sort one array. In fact if you use a std::vector … | |
Re: Take a look at my response to this thread: [url]http://www.daniweb.com/forums/thread242984.html[/url] That should give you all the information you need. Cheers for now, Jas. | |
Re: Despite working as a programmer for several years, I wouldn't consider myself an expert per se. I'm still learning new things every day. But I'd have to echo what niek_e said and say that the main thing you need on the road to becoming an expert is experience with the … | |
Re: [QUOTE=Mclovin1234;1066107]Hi i am doing a program that has to add up the percentage for example if i get one question wrong it adds to the percentage and after i answer 20 questions i would get the final mark but i dont get why it doesnt work. [CODE] void multiplier(int difficulty)// … | |
![]() | Re: [QUOTE=stevee1984;1066059]Hi all, and must say a great looking forum! I wish to start developing c++ apps on Linux and would like to know what GUIs are supports out of the box on Linux, especailly the main distros anyway? QT, KDE, GTK, etc? I basically want to write gui apps that … ![]() |
Re: I think that learning about tweening is a great idea, you should do it! heh heh! When used properly tweening can make your animations look a lot more natural, realistic and life-like. There are some great free tweening libraries available for AS3 (like tween lite [url]http://blog.greensock.com/tweenlite/[/url] ) which are actually … | |
Re: Your GetData and GetSize functions need to be declared const e.g. [CODE] unsigned GetSize() const // This { return n; } [/CODE] [CODE] void* GetData() const // and this needs to be const { return v; } [/CODE] Because the parameter 'a' to the Allocate classes operator = override function … | |
Re: [QUOTE=benregn;1064650]Hi, I hope this is the right place for this question. What program can I use to make nice looking .pdf files from Word documents? Thanks[/QUOTE] There's a free tool called PDF Creator ([url]http://www.pdfforge.org/[/url]) which allows you to print your word documents to .pdf. (In fact you can print from … | |
Re: Hey there! If I am following you correctly, one thing you could do I suppose is put two instances of your object onto the stage and use the bottom one as a placeholder (so it's not drag enabled.). That way, when the user drags the top object off, there is … |
The End.