2,898 Posted Topics

Member Avatar for TheNewbie1234

You need to use your setX and setY functions to set the new positions, as so: if (inputEvent.Event.KeyEvent.wVirtualKeyCode == VK_DOWN) { if (maze.CanPlayerEnterSpace(person.GetX(), person.GetY() + 1)) person.SetY(person.GetY() + 1); } if (inputEvent.Event.KeyEvent.wVirtualKeyCode == VK_UP) { if (maze.CanPlayerEnterSpace(person.GetX(), person.GetY() - 1)) person.SetY(person.GetY() - 1); } if (inputEvent.Event.KeyEvent.wVirtualKeyCode == VK_LEFT) { if …

Member Avatar for Schol-R-LEA
1
1K
Member Avatar for Xantipius

I have the same problem as Rev. Jim, my names are Sven Mikael. Mikael is the given name I go by, and Sven is my forename, like a middle name (not used) but that goes before my given name, which is usual in Sweden, but not in Canada, where I …

Member Avatar for vinnitro
-1
287
Member Avatar for AmrMohammed

First of all, only non-static member functions can be declared as `const`. The const-ness applies to the object on which the member function is called, that is, the object and thus all the data members it contains. Here is an example: class Foo { public: int bar; void member_func() const; …

Member Avatar for deceptikon
0
161
Member Avatar for ztdep

There are a few ways to solve this problem reasonably quick. They generally depend on how much memory your are willing to spend (i.e., the classic computer science lesson: memory-complexity can often offset time-complexity). The "slow" method, as you described, is to go through all faces and then for each …

Member Avatar for ztdep
0
177
Member Avatar for saini.jaspreet7
Member Avatar for KhizarIqbalEngr

> How Can I Restricted The Movement Of The Cursor And Determined At Which Point/Pixel User Hit Any Key..!! As you record the key-strokes to move the cursor, first check that the movement is allowed (remain within the ranges of x and y values), and, of course, keep track of …

Member Avatar for KhizarIqbalEngr
0
2K
Member Avatar for sherubdorji

Categorizing C++ as an OOP language is very reductionary. C++ is a multi-paradigm language. C++ was originally motivated by the OOP "revolution", and that played a major part in its original popularity. In modern times though (21st century), the popularity of C++ is mostly driven by what Alexandrescu calls "zero-overhead …

Member Avatar for mike_2000_17
0
265
Member Avatar for ztdep

There are a number of problems with your code. First, if you are going to define the multiplication operator as a member function of the class template, you need to make it a `const` function: // the prototype in the class template declaration: double operator*(const TinyVector<T_numtype, N_length> &) const; //<-- …

Member Avatar for ztdep
0
233
Member Avatar for nitin1

> :'( but how will i live without him ? he is my heart ! to whom can i tell my feelings ? my parents are also so impatient. his ambitions, care, love , he himself i gonna miss. I'm sad to hear that. I think you ought to tell …

Member Avatar for TonyG_cyprus
0
441
Member Avatar for <M/>

One fun moment was during my senior year advanced math classes. When we were doing exercises, which is to say, when the rest of the people were doing exercises while I was hacking together an RPG game in assembly language for my TI-83 calculator. As people started having trouble and …

Member Avatar for <M/>
0
329
Member Avatar for ScarWars9

Wow.. this is hard to pin down, I've been mostly programming as a hobby and now using my skills as a tool for doing robotics research. I mean, it's always been all about challenging myself with impossible tasks, now my job is to solve impossible problems. So, I have no …

Member Avatar for <M/>
0
296
Member Avatar for imBaCodes

(Disclaimer: do not try this one if you don't like to get slapped in the face) "Do you work for a jeans factory? [Why?] Because you're working your way up a ply in my pants."

Member Avatar for <M/>
1
409
Member Avatar for solomon_13000

> I would like to find out why is it not necessary for a method to declare an exception when coding in C++? Actually, now with C++11 (latest standard), it is more than just "not necessary", it's deprecated (compilers must still accept the code, but it's highly discouraged to use …

Member Avatar for mike_2000_17
0
228
Member Avatar for abelLazm

If wealth is supposed to trickle down, 99% percent of the people must be standing under a giant **waterproof** cover. **Plethora**

Member Avatar for vinnitro
6
1K
Member Avatar for L7Sqr

This is very nice! It's a neat little piece of designed code to solve a somewhat simple problem but in a fairly generic way. That's cool, it's the kind of code I like to see. As usual, I could point out a few things to improve. At least, there is …

Member Avatar for happyuk
2
6K
Member Avatar for <M/>

What I hate are all those French words or expressions that English-speakers use and speak with a stupidly exagerated and totally wrong pronounciation. Like "rendezvous" or "laissez-faire", even the online dictionaries have a ridiculous pronounciation, listen [here](http://www.merriam-webster.com/dictionary/rendezvous) or [here](http://www.merriam-webster.com/dictionary/laissez-faire). > Why don't people just call it the stomach or abdomen, …

Member Avatar for <M/>
0
475
Member Avatar for ncis_sg1

The O() means "of the order of". Generally, a function is of the order of its biggest term, i.e., the term that, as n becomes very big, dominates all the others, in other words, the only term that really matters for large values of n. So, if `f1(n) = A*n …

Member Avatar for mike_2000_17
0
209
Member Avatar for Tinnin

> Engineering is a very down and dirty profession, the theory of how an internalcombustion engine works, and dismantling and re-assembling a nice clean college workshop engine is good practice, but cannot compare with a ten year old, poorly maintained breakdown in the street. Kinda off-topic, but this got me …

Member Avatar for TonyG_cyprus
0
223
Member Avatar for deltascrow

> AFAIK "rank" cannot be bought. It must be earned. I wish that could apply to politics too.

Member Avatar for deceptikon
0
305
Member Avatar for bsimms86

I think the most common solution is to use an on-the-fly encryption of the backup file-system. Tools like `dm-crypt` (part of the Linux kernel since quite a while) and `true-crypt` allow you to mount an encrypted file-system, just like you mount a HDD partition but with encrypted key protection. The …

Member Avatar for bsimms86
0
1K
Member Avatar for finston

> I have compiled and linked my code written in C and C++ and calling certain Windows APIs to a Win32 .dll using MinGW in Code::Blocks runnings on Windows XP. My code has also been compiled to and linked to create a Win32 .exe, which works successfully whilst communicating serially …

Member Avatar for mike_2000_17
0
240
Member Avatar for LastMitch

When I grew up, in the school yard, we used to play soccer only during the winter. The summer was for basketball, kickball, dodgeball, and street hockey, and the winter was for hockey, soccer and football. Playing soccer in winter time (and outside) is pretty nice actually, I don't know …

Member Avatar for Assembly Guy
0
338
Member Avatar for game06

I second deceptikon on that, grab some screen-shots and some UML graphs, print them out, and pop them into a nice-looking sleeve that you can carry to the interview. Hand them to the interviewers at the start of the interview as a "here are some examples of my past projects" …

Member Avatar for <M/>
0
204
Member Avatar for deltascrow

I don't mind that there are lots of "inferior" programmers, in the sense that their knowledge is limited to being able to push the right buttons here and there to get the job done without much understanding of either the technical details or the theoretical aspects of things. I don't …

Member Avatar for mike_2000_17
2
192
Member Avatar for azareth

Consistent indentation is really important. I tend to prefer 2 spaces, I don't mind 4 spaces, more is too much IMO. Too much indentation breaks readability of the flow of the code. I tend to use K&R style for braces. I like line lengths to be limited to about 80 …

Member Avatar for <M/>
0
246
Member Avatar for tehsmartniss

The language standard and the standard library is developed as a negociation between implementors (who need to comply to it) and users (who want features from it). If the amount of users that request a particular feature very strong and all implementors have little or no problem providing it (they …

Member Avatar for Schol-R-LEA
1
1K
Member Avatar for asifalizaman

> you guys must learn java programing language because i think aproximate one billion devices are running java... Since most JVMs and most components of the Java's standard library implementations are actually programmed in C / C++, and most OSes are programmed in C / C++ / ASM, the number …

Member Avatar for mike_2000_17
-3
578
Member Avatar for Dani
Member Avatar for TonyG_cyprus

I'm a bit younger than you guys... The first (real) computer we had was a Pentium MMX 200 MHz with I believe a blazing-fast 8Mb 3D accelerator card! So, my first experiences were more along the lines of playing one-on-one death-matches of Duke Nukem 3D over the dial-up modem (i.e., …

Member Avatar for Reverend Jim
0
286
Member Avatar for VernonDozier

I doubt that Vernon is still developing this game, four years later. But the scrabble dictionary is a good suggestion that others might benefit from. For that reason, I won't vote down your post, but be careful in the future not to resurrect threads from years past.

Member Avatar for Saumil11
0
4K
Member Avatar for chester1908

Are you referring to [Job Scheduling](http://en.wikipedia.org/wiki/Job_scheduler) or [CPU Scheduling](http://en.wikipedia.org/wiki/Scheduling_(computing))? For the former, there isn't much to say, it's what the `cron` tool does, and it isn't particularly challenging or involving any special algorithm or anything. For the latter, however, what you'd want to look at is the [Completely-Fair Scheduler](http://en.wikipedia.org/wiki/Completely_Fair_Scheduler) and …

Member Avatar for rubberman
1
329
Member Avatar for dlgmu537

An IDE has a number of practical advantages. And they also depend largely on what kind of projects your working on. When you're just "writing code": An IDE helps you with: - reading the code more easily by highlighting the syntax (language keywords, comment blocks, etc.). - keeping the code …

Member Avatar for mike_2000_17
-1
128
Member Avatar for tomz6

Standard file-streams are buffered for efficiency. They read data in advance from the file and temporarily store it in a buffer which is emptied as you extract data from it. So, just use the [`std::ifstream`](http://www.cplusplus.com/reference/fstream/ifstream/), which has an underlying [`std::filebuf`](http://www.cplusplus.com/reference/fstream/filebuf/) accessible through [rdbuf()](http://www.cplusplus.com/reference/fstream/ifstream/rdbuf/). Normally, the buffering is set to be …

Member Avatar for mike_2000_17
0
304
Member Avatar for tomz6

The trick is just to get a window handle for whatever surface you want to draw on, that is, a valid `HWND` handle that points to where you want to draw. This can be done [easily in Qt](http://jholewinski.org/blog/direct3d-11-with-qt-4/). I assume most other GUI libraries would provide a similar thing. It …

Member Avatar for mike_2000_17
0
212
Member Avatar for eric.inclan.3

I'm not sure, but I'm inclined to think that the indices `i` and `j` should be declared within the for-loop statement. Otherwise, each parallel thread will be using the same variable, which is not going to go well. I would try this: #pragma omp parallel { #pragma omp parallel for …

Member Avatar for eric.inclan.3
0
518
Member Avatar for elmousa

I would say this isn't something that you would do in C++. There are many system administration tools that would help you implement this as a script that is scheduled to run periodically and upon connection of any new "directorate". For example, [the `rsync` utility](http://en.wikipedia.org/wiki/Rsync) would be perfect for the …

Member Avatar for elmousa
0
255
Member Avatar for tomz6

This certainly exists, the main one that I know of is [OpenMP](http://en.wikipedia.org/wiki/OpenMP). Pretty much [all modern compilers](http://openmp.org/wp/openmp-compilers/) support openmp. It is really easy to use, you just put some `#pragma` statements at the appropriate places, and you configure the number of threads to use (in relation to your number of …

Member Avatar for mike_2000_17
0
203
Member Avatar for Awais Ali

Well, facebook is a social network, which has the word network in it, which usually implies a graph structure. And, coincidently enough, facebook uses a graph structure at its core, how surprising... I didn't need to look far to find that out, look at the [URL="http://en.wikipedia.org/wiki/Facebook_Platform"]wiki[/URL] or the [URL="http://developers.facebook.com/docs/coreconcepts/"]developers' page[/URL].

Member Avatar for BigBang@12
0
833
Member Avatar for manchurianCEO

> I disconnected the CMOS battery for quite a while, twice, and the problem won't go away. You should try resetting the "Clear CMOS" jumper on your motherboard, it should trigger a flashing of the factory-original BIOS. That's usually better than unplugging the battery. And if that doesn't solve your …

Member Avatar for mike_2000_17
0
247
Member Avatar for Xorlium

This is a good question. Iterators are awesome but with the implementation of a custom iterator often comes a number of non-trivial issues, especially when you're pushing the envelop. My first recommendation would be to get well acquainted with the different [iterator concepts](http://www.cplusplus.com/reference/iterator/), if you haven't done so already. They …

Member Avatar for Xorlium
1
325
Member Avatar for triumphost

First, a bit of vocabulary. Given a class, an object of that class will contain data members and base-class objects (the instance of its base-classes), these two things are referred to as *sub-objects*. So, the fundamental thing to understand here is that, from a memory perspective, an object and the …

Member Avatar for mike_2000_17
0
17K
Member Avatar for <M/>

I guess the endorsement system can't keep up with the rate at which your "friends" in California register phony accounts and endorse you (i.e., most of your endorsements are from people from California, who registered in the last month, and barely posted anything themselves). You're not exactly coming to this …

Member Avatar for <M/>
0
597
Member Avatar for Potgiesh

I would just chip in another vote for Qt. I've had nothing but pleasant experiences working with this library and the tools (drag-drop designer, IDE, qmake and cmake add-on), it's been smooth sailing all the way and the feature-set is very complete, stable and looks good and the same everywhere …

Member Avatar for mike_2000_17
0
467
Member Avatar for craig.durnin.1

The CSV format just means Comma-Separated Values. A typical CSV file would look like this: x, x2, x3 1.0, 1.0, 1.0, 2.0, 4.0, 8.0, 3.0, 9.0, 27.0 4.0, 16.0, 64.0 It's that simple. Just the values, separated with commas. Excel can also import any other similar thing, like values separated …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for Reverend Jim

I guess it would make more sense to have the highlighting occur on the "Watched Articles" at the top of the page. I like the idea.

Member Avatar for Dani
0
251
Member Avatar for nishad_forums

Writing a GUI application in C++ must involve one of many GUI libraries out there. As Tinnin mentioned, some possibilities are [SFML](http://www.sfml-dev.org/) or [SDL](http://www.libsdl.org/), and in that same vein there is the Win32 API. All these options are very low-level. They can be useful for making a computer game where …

Member Avatar for mike_2000_17
0
3K
Member Avatar for Labdabeta

For me, these characters seem to appear when I do ALT + SPACE. I sometimes get those because I use a french-canadian keyboard and the `{}` and `[]` brackets (and a few others) require using the ALT key and they are often followed or preceded with a space, and so, …

Member Avatar for Labdabeta
0
828
Member Avatar for Xorlium

This is not a bug, it is the expected behaviour. There is a rule in C++ that overloading of member functions is limited to a single class scope. Basically, calling `SomeFunction` on a `Derived` object causes the compiler to look for overloads within the `Derived` class only. If I compile …

Member Avatar for mike_2000_17
0
211
Member Avatar for triumphost

The actual problem is not the compiler, but the system libraries you need to link to. This is why you get all these linker errors. So, what is needed is an installation of GCC with the two sets of libraries, i.e., for 32bit and 64bit systems. Try the [TDM-GCC releases](http://tdm-gcc.tdragon.net/), …

Member Avatar for triumphost
0
382
Member Avatar for Labdabeta

> I already created a version that just stored numbers as "before decimal point [unsigned array]" and "after decimal point [unsigned array]". The decimal point? That's untenable. Are you saying that in order to store the number `1e30` or `1e-30` you need to store a long array of zeros followed …

Member Avatar for deceptikon
0
236

The End.