- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
52 Posted Topics
Hi, This seems like a really simple question. Most of the time I choose to show extensions for known file types, but sometimes (most notably when renaming files by hand) it is convenient to hide them. This is achived by checking the checkbox at: Tools -> Folder Options -> View … | |
I was trying to revise my linked list and implement it in C to check if there is a difference in performance... just as a sort of weird hobby.. In the absence of templates I'm trying to figure out how to pass a type as a parameter for this purpose. … ![]() | |
how do I launch a python script within the IDLE python shell from the command line? basically I want to use Notepad++ as my editor, but when I press F5 I want my script to run in the IDLE python shell (NOT in a cmd window). If I do C:\Python26\Lib\idlelib\idle.pyw … | |
Hi, I have written a C# application which uses Tao Framework bindings for OpenGL and FreeGlut. It references two assemblies (Tao.OpenGL and Tao.Freeglut) and also requires that the appropriate OpenGL and Freeglut dlls be somewhere in the system. How can I publish this application in such a way that the … | |
I have a method that creates a sorted dictionary of things [code=csharp] SortedDictionary<string, MyClass> sortedStuff = new SortedDictionary<string, MyClass>(); // add some items to sortedStuff [/code] now all I want to do is retrieve the "maximum" value from the dictionary, where maximum is determined by the comparison of two strings … | |
I'm new to java (like a few weeks new), but coming from a C++ background.. This is going to sound retarded, but... can someone explain to me how I can make a BigInteger object to make it have the same value as another BigInteger object? That is they have to … | |
Re: If you're sure there's no password set, then try to set one first from user options. I have no idea why this would work, but windows is peculiar so it might. Otherwise, there are tools available which will remove the administrator password from windows. The hiren boot tools package comes … | |
I recently got a copy of ReCycle 2.1 from a friend and when we installed it at the time I put in random gibberish for the name and organization fields. When I tried to reinstall it later these fields remained.. I'm really OCD when it comes to this sort of … | |
Re: [code=cplusplus] #include <ctime> ... clock_t startTime = clock(); // your test loop goes here for (int i=0; i<100000; i++) ; clock_t endTime = clock() - startTime; cout << "The loop took " << endTime / CLOCKS_PER_SEC << " seconds\n"; [/code] | |
Re: Well first you determine what your symbols represent. In your system it seems that A = 1 ... Z = 27 So you're talking about a base 28 system. Therefore a string like "ABCD" will mean A * 28^3 + ... + D * 28^0 My guess would be that … | |
[b]This is a long post with no specific questions as such. I'm just looking for any advice from people with real-life experience in the software development arena.[/b] ---------- Intro: I've just taken up a summer job, and I was really enthusiastic about this. It will be 12 weeks of C++, … | |
I'm finishinh up my game for submission. Right now I'm doing the menus, and it's highly procedural, nasty long-winded chunks of code, as you can imagine.. And I'm trying to implement the following logic as part of a huge compound switch block: If MENU_FLAG is STATUS, then display the status … | |
Re: Why not generalise the linked list and then create one with a struct { int ip; int uri; }; or something like this? Is this is supposed to be written in C? | |
Re: You are using namespace std? | |
Re: You can use isalpha() to check if it's a letter, or explicitly check for a non-space character. Provided you already have a system for checking guessed letters in general, this will be easy to adjust. Here is info: [url]http://www.cplusplus.com/reference/clibrary/cctype/isalpha.html[/url] There are loads of other ways of doing it too.. Anyway … | |
![]() | Re: Hey, you have all the difficult bits already figured out! There are only two problems in your code: Firstly, when you derive a class that has a non-default constructor it does not automatically inherit to the derived class. So when you call creatures[3] = new Centaur("Florence"); it gives you an … ![]() |
I would like to create a specialisation of.. template <typename CEnemy_Ty> class CEnemyManager {}; ..for a class called CTank which is a CEnemy But by defining.. template <> class CEnemyManager<CTank>{} ..it means I have to copy+paste huge chunks of unchanged code, just to change say one or two functions. By … | |
Re: You need to get familiar with event-driven programming. SDL is a good place to start. Running two functions at once is possible by using multi-threading as was pointed out but it is generally used for far more complicated things.. | |
I've searched for linked lists quite a lot (and read some books), but I've yet to find one that suits my needs. I wanted one that is: templated, provides only the bare bones of what's needed and easy to read and understand the code (simple, consistent variable names, meaningful and … | |
This is a past exam question that I'm doing for revision. I didn't think this was going to be as tricky as it turned out. I would just appreciate some advice on how I can make it more elegant/professional/etc.. I'm sure this has been discussed before and there are some … | |
Re: TC++PL is also floating around on pdf, but you didn't hear it from me.. | |
Re: I ran into a similar situation as yours, so I'll tell you what difficulties I encountered and how I chose to deal with them. I'm still learning though, same as yourself, so you're better off asking one of the gurus here.. Anyway, any sort of array or STL container is … | |
Re: I ran it just now for balance = 100 They're not addresses, they're numbers in scientific notation. Basically, not all paths in your functions return values. So for some values (e.g. 100) your function isn't returning anything, which results in weird behaviour and large, meaningless numbers as a consequence. Try … | |
Let's say I'm sure that one of my base classes will never be instantiated, so I decide to make it abstract. But at the same time all of its functions have definitions because they're common to all derived classes (e.g. Physics() will be the same regardless). So I know that … | |
I've been reading a lot of info, but templates are really too new for me at the moment, and I can't find any examples similar to what I'm trying to do. Basically I have a template container defined like this: template <class CMissile_Type> class CMissileManager { std::vector<CMissile_Type> missiles; }; The … | |
Thanks for all the help I've received in 2007, mainly the C++ forum. You guys are great, and I hope you all have a nice year. | |
Just trying to get my head around linked lists and I'm trying to all the standard container functions.. For a singly-linked list are these algorithms correct? [code=cplusplus] void pop_front(const T& t) { // Deallocate memory pointed to by head node<T>* tempNode = head; delete head; // Get new head head … | |
I'm trying to make the second parameter a default parameter that is the same as the first, or different if I want it to be different.. Why doesn't this work? And is there a way around it, other than by iterative overloads? void LoadFile (std::string filename, std::string key=filename) { //blah … | |
So let's say I have a class called CSprite which loads a sprite sheet. Within that class will be at least one CAnimation object which takes user-defined snippets from the sprite sheet and loops them.. so for example I might want: CAnimation m_AnimNormal, m_AnimOnFire; inside the actual CSprite object. The … | |
I know this is a slightly esoteric question, but I'm just curious how you guys define your function macros. Do you put a semicolon at the end or not? For example: [code=cplusplus] #define EVENT_RESIZE(_event) ::SDL::HandleEventResize(_event, hScreen, fnSDLKey); // or #define EVENT_RESIZE(_event) ::SDL::HandleEventResize(_event, hScreen, fnSDLKey) [/code] In the first case, the … | |
I have this code [code=cplusplus] CPoint* points; int numPoints (200); points = new CPoint[200]; [/code] I have another class called CPlanet, and a bunch of pointers like: CPlanet* pSun = new CPlanet; ... and CPoint and CPlanet call the same functions, so I would like to use -> to call … | |
I think I've been up too long at this stage.. I think this is a really stupid question: How do I declare all my objects from main() ? I have an object 'sun' of the class 'CPlanet' and within that class there is an instance of the class 'CAnimation'. But … | |
Hi guys, How do I pass arguments into into the constructor if I'm using new to creat an array of objects? So for example: CParticle* parts; parts = new CParticle[100]; parts is declared globally, but initialised later on in the code.. my lecturer suggested this strange syntax: parts = new … | |
Hi guys, I have an MFC application and I made a class called CCustomFilter.. it basically brings up a dialog with some edit boxes, etc.. the user is able to enter a mask and apply the filter.. Now, from the main dialog I am instantiating it as follows: [code=cplusplus] CCustomFilter … | |
Hi everyone, I've been googling this for a long time, and most of the hits are about keyboard shortcuts in the actual IDE... it's so annoying.. :( I'm working on a pretty big VS project (about 20 source files).. I have to add some keyboard functionality to it... simple stuff … | |
Re: I've got a PDF copy of The C++ Programming Language, written by the creator of C++. I'm not sure if it's ok to post it here though.. | |
Re: These kinds of problems are all basically the same... they involve integer division and modulo operations.. In other words 1128 / 10 = 112, and 1128 % 10 = 8. 112 / 10 = 2, etc.. You can see where I'm going with this yeah? A nice twist on this … | |
Re: Funny enough, there's no guarantee that the STL is actually written in C++. I was reading somewhere that infact sometimes it breaks the rules.. but it's ok because it's all sealed shut.. If you google "c++ dereferencing null pointer" you might find the article.. As for the other libs, have … | |
Re: Hi mate, I didn't read through all the source code, but basically you can use getline to do this. getline has the following parameters: std::getline ( source stream , desination stream , delimeter ) There are several ways to use this.. e.g. [code=cplusplus] ... std::string temp, total; while (!file.eof()) { … | |
Re: Yeah Kate is quite decent, and I'm pretty sure it comes shipped with Kubuntu.. I think Eclipse is another IDE, but I'm not sure for what.. have a look for it anyway.. Oh and to see if GCC is installed, just write a simple hello world program (hello.cpp), and cd … | |
Hi, I'm basically trying to create captions that will go under an image in my project.. the problem is that if the caption line is too long, it will get chopped off... so I'm trying to write a function that will re-chop a string with endl's according to the width … | |
Re: lol I have "Teach yourself C++ in 10 minutes" ..it takes 10 minutes to read a page sometimes.. It's a good book though! kinda pisses me off the way he puts a semicolon after if/for braces.. there are so many syntax errors that I'm beginning to get the feeling he … | |
Re: During this year we (my college year) have covered far less than 60% of basic C++ syntax.. we never touched on pointers, structures, classes, namespaces or any modularization... whatever else I learned I learned as a hobby. And yet, sometime in the third week of next year we will start … | |
Re: This library is good for animations.. you can download the demo and see what can be done. Actually the menu that comes up as soon as you launch the demon is a fairly decent GUI too.. The whole package is just one header file, and it's very easy to use … | |
They seemed to make sense to me, until I read somewhere than an example of a constructor is [code] std::ifstream myFile("filename.txt"); [/code] ..the author went on to say that (obviously, in this example) they can be called after an object is instantiated, ie: [code] std::ifstream myFile; // some code here … | |
Re: Basically, call-by-reference functions allow the function to work on the actual variable (within main). Call-by-value functions, copy the value of the variable into the function, with the original variable remaining unaffected. The reason you would need to use call-by-reference will become apparent to you pretty soon.. for example write a … | |
Re: If you're not allowed to use arrays, use the .at and .length string member functions. Make sure to #include <string> [code=cplusplus] #include <iostream> #include <string> using namespace std; int main(int argc, int* argv[]) { string word; getline(cin,word); /* then depending on what kind of processing you need, you might use … | |
I basically need to write a program that will display all images in a directory, sequentially, and either create or open an existing corresponding text file, and allow a user to write/dictate into it. (e.g. So working in a directory containing one.tif, two.tif and three.tif, the program will open/create one.txt, … | |
Re: Some advice about books: try to get a book that works on and develops one single program as it progresses, from basics to objects and whatever else.. It's better than books with hundreds of little shitty exercises, because (a) you learn faster, (b) its more incentive to go onto the … | |
Why does this not work, and are there other alternatives? This will eventually be used in a loop of sorts.. the different fileName's will be determined by the program in real time.. [code=cplusplus] #include <fstream> #include <iostream> int main (int argc, char** argv) { std::string fileName; fileName = "testFile.txt"; // … |
The End.