2,898 Posted Topics

Member Avatar for cambalinho

What you want is the size of an element of the array, which is not `sizeof(typeid(arr))`. You need to use `sizeof(arr[0])`. Don't worry about if `arr[0]` exists or not, because the `sizeof` operator does not actually evaluate the expression, only its type. Warning: The method that you are using, i.e., …

Member Avatar for cambalinho
0
799
Member Avatar for praveen1993
Member Avatar for Ancient Dragon

Yeah, I've referred people to that article so many times. There are great points, and it gives a good dose of "realism".

Member Avatar for vegaseat
2
416
Member Avatar for FairyA

> I thought `* value` is the number the pointer `value` points to Yes, but in order for a pointer to point to something, you need to allocate some memory and set the pointer to point to that memory. Before you initialize a pointer, it just has some arbitrary value …

Member Avatar for FairyA
0
189
Member Avatar for mark5rockzz_1

> So any conclusion for this? Did you just say impossible? Nobody's talking about it being "impossible", everything is possible. What deceptikon said is that it currently does not work that way (not in C++, and not in any other language that I know of), and that making this work …

Member Avatar for mark5rockzz_1
0
294
Member Avatar for LokiSoliman

Another hint that might help you is this. The first even number higher than `x` can be calculated as `2 * ((x + 2) / 2)` (and the parenthesis matter, because this relies on integer division). You can use Schol-R-LEA's loop to do the rest.

Member Avatar for Ancient Dragon
0
164
Member Avatar for almostbob

Around the time I was born, my parents had a Rottweiler, but she died young due to cancer. Rottweilers are awesome dogs too, they are super smart, gentle, don't shed much (short hair), but they have lots of energy, so you have to be ready for that (i.e., it's not …

Member Avatar for Agilemind
2
389
Member Avatar for NardCake

There are two common options for the code generation. Most compilers have an "intermediate language" that is kind of like C but less human-readable (i.e., a basic procedural language, but more compact). Other compilers simply generate C code and then compile it (for example, the Comeau C++ compiler just generates …

Member Avatar for mark5rockzz_1
0
356
Member Avatar for filipgothic

> anyone, this is from second year of IT, anyone passed that? Seriously? What did you do the first year? Make macaroni art? From the example: if (x == 0) then // O(1) simple variable access for i = 1 to n do // O(n) a[i] = i; // O(1) …

Member Avatar for filipgothic
0
264
Member Avatar for Labdabeta

Good to hear you started using LaTeX. Once you get used to it, you'll probably never go back to using MS Word / LibreOffice programs. And obviously, Tex/LaTeX is not a legacy language, even though it's quite old (1978). At least for most scientific publications, it's the *only* viable option. …

Member Avatar for mike_2000_17
0
394
Member Avatar for Dani

Hi Frank, It's a bit funny that you resurrect your presence in forums by resurrecting a 6 year-old thread (which we usually frown upon). Anyways, welcome to Daniweb! I should bow my head to you as I started my programming life with your products. Back when Borland still carried time-unlimited …

Member Avatar for seblake
0
1K
Member Avatar for aVar++

> where they have all this awesome software and I always wonder what it is. 3D animation / modeling is usually done with a professional suite of 3D animation software, and often in combination with in-house software / add-on scripts. The most popular software, from my limited and somewhat out-dated …

Member Avatar for aVar++
0
158
Member Avatar for ganges

> One learns to play a piano well only by years of practice -- same with progamming languages. Good analogy. I'd add to it: One doesn't learn to play a piano well by only playing the same tune over and over again. You have to find new challenges all the …

Member Avatar for NardCake
0
442
Member Avatar for phorce

The problem with using the maximum value of a double is that you will most certainly lose all meaningful value in your samples array. For example, if you do `samples[i] / std::numeric_limits<double>::max()`, then it won't really matter much what the value of `samples[i]` is, unless it is extremely close to …

Member Avatar for mike_2000_17
0
8K
Member Avatar for dospy

A heap corruption problem is almost always caused by calling `delete` on a pointer that does not point to memory that was allocated with `new`. And yes, the `strcpy` function does not allocate memory, it only copies data from one location to another, it is your job to allocate the …

Member Avatar for RonalBertogi
0
285
Member Avatar for Dani

The post quality score is definitely the best indicator for how worthy and awesome a member is. Shamelessly coming from another 97% scorer ;) (I'm sure JorgeM agrees with me!) > ... says the person who has a 97% post quality score ;) ... says the person who has a …

Member Avatar for JorgeM
2
237
Member Avatar for Reverend Jim

I don't know how to feel about this. On the one side, I'm happy that the companies speak plainly and honestly about the crimes of the US government, and refuse to be complicit with them. On the other hand, I would like to see them refuse to comply (and not …

Member Avatar for Reverend Jim
0
828
Member Avatar for <M/>

I've heard the phrase "with its new colors, Apple is redefining what an iPhone can be".... that smells of desparation and of extremely complacent "critics". I mean, Apple is, of course, legendary for over-hyping minor things as being revolutionary breakthroughs and paradigm shifts, but this takes it to a whole …

Member Avatar for <M/>
0
192
Member Avatar for phorce

You must be very tired indeed. ;) When you construct the *object* "w" of *class* `Something`, it will contain a `data` vector with a size of 100. When you construct a second *object* "f" of *class* `Parser`, it will contain a `data` vector with a size of 0, because that's …

Member Avatar for iamthwee
0
153
Member Avatar for phorce

> Probably not the best implementation, but, hey! If anyone has any more, feel free to post :) Definitely not, especially considering that it has a blatant memory leak. Overall, I have a really hard time understanding what you actually want to accomplish. Even the title is confusing "CRTP without …

Member Avatar for mike_2000_17
0
189
Member Avatar for happygeek
Member Avatar for nitin1

You want to know the reasons behind currencies going up or down in general? To answer that, you have to understand what money is. Fiat currencies (which are most currencies today) are records of debts that the treasury (government or a major bank) has incurred with the central bank (the …

Member Avatar for vegaseat
0
245
Member Avatar for Chinney

The point about learning Java well before moving on to C++ is a fair point from the perspective that Java might be an easier language to learn the basics. But that's the important point "the basics". Java and C++ are very different, and Java is far more narrow in scope …

Member Avatar for jayshri.shah.10
0
270
Member Avatar for talha.nehal

Qt is definitely the best, IMHO. It is not true that you need another IDE for using Qt. But it is true that it is easier with certain IDEs that have a tighter integration with Qt. This will be true for any GUI library out there. As far as I …

Member Avatar for mike_2000_17
0
347
Member Avatar for pritaeas

I have a bug to report. When I click on the "XX hours ago" to jump to the last post on a thread, it gets me there but the top of the last post comes flush with the top of the browser window, and then, the floating "<DANIWEB>" purple bar …

Member Avatar for Dani
0
1K
Member Avatar for pritaeas

Yeah, "read" is in the past tense. Stupid English language. I was also even more confused with the "read" and "me" put together, for obvious reasons. I agree that the new layout is a little bit cluttered. And as far as style harmony goes, it seems the main thing that …

Member Avatar for diafol
0
1K
Member Avatar for nitin1

The point is that you could evaluate the operands in any order. Lets add some parentheses: ( ( ( cout ) << ( a++ ) ) << ( " " ) ) << ( ++a ); For any of the `<<` in the above expression, the stuff above it or …

Member Avatar for vijayan121
-1
219
Member Avatar for NathanOliver

The paragraph is very poorly written. I understand what it is referring to, but the wording of the text is horrible and imprecise. What it is referring to is the fact that template instantiations have internal linkage. This is to guarantee link-time satisfaction of the ODR (One-Definition Rule). Normally, if …

Member Avatar for vijayan121
0
163
Member Avatar for somjit{}

That's odd. I can explain the "posts voted down" section showing only 3 posts. This is because this section only shows the posts that are currently negative overall. This means that all those down-votes were counter-balanced by the up-votes on the same post. But the overnight down-votes is very weird. …

Member Avatar for deceptikon
0
306
Member Avatar for Skyline77
Member Avatar for somjit{}
-7
588
Member Avatar for pdwivedi

Any standard permutation algorithm will do. You have seven slots to fill, and you can permute the elements just like you would permute the elements of any array. C++ has a [standard implementation](http://www.cplusplus.com/reference/algorithm/next_permutation/) for it.

Member Avatar for pdwivedi
0
495
Member Avatar for st_uni-trier

The survey is a bit weirdly formulated. The questions seem to refer to the "last sketch/diagram" that I made. That could happen to be anything from the most involved sketch that I ever drew to the most trivial doodle on a random piece of paper. I went by the assumption …

Member Avatar for st_uni-trier
0
255
Member Avatar for iamthwee

I just installed it on my old laptop (which had Fedora 19 on it, which has sort of died due to bugs and other issues). I like it so far. That laptop is old (6 years) and I don't use it for any heavy work (I use it as kind …

Member Avatar for Assembly Guy
0
175
Member Avatar for jackmaverick1

There are a few common options (and it's best to stick to what is common, and thus, most likely familiar to users of the library). The first important question to ask is: are you targetting an ABI-stable platform? In other words, do you plan to support Windows, or only unix-like …

Member Avatar for mike_2000_17
0
246
Member Avatar for ProDev7

That is an absolutely terrible example, it should never appear in a book, or at least, not one worth reading (unless it is presented as an example of what not to do). In any case, what this MACRO is trying to do is automatically generate a list of objects of …

Member Avatar for ProDev7
0
144
Member Avatar for mblan180131

> oh i thought that the x-- was the bit processing speed but its the architecture i guess. thanks! These are names for the instruction set (also called the architecture), they are technically not supposed to be named after the 32 vs. 64 bit thing. I don't know what you …

Member Avatar for Assembly Guy
0
246
Member Avatar for webecedarian

It sounds like some sort of phishing scam. When I google for those numbers, I get hits of all kinds, mostly saying that each of these numbers are tech-support numbers for microsoft / MSN / hotmail, facebook, norton, and just about any other prominent IT company. My guess is that …

Member Avatar for Ancient Dragon
0
199
Member Avatar for general2012

We don't have a forum section dedicated to matlab, but you can post under "Software Development" directly and be sure to add tags to your question, specifically "matlab".

Member Avatar for general2012
0
73
Member Avatar for gcardonav

> then whats the difference between using namespace and #include? doesnt #include also tells c++ to go look in this header file for this function or statement... Not exactly. A `#include` line is very little more than a copy-paste instruction. It tells the compiler to look for the given file …

Member Avatar for StanleyLau
0
4K
Member Avatar for MasterHacker110

> A programmer having 5+ years experience in C++ programming, in the system and also game department... more or less what will they make? Of course, this depends on many factors, with respect to your qualifications, position, and your company's size. Generally speaking, it's around the mid 5 digits (USD), …

Member Avatar for mike_2000_17
0
337
Member Avatar for Jed_1

There are a number of bugs in your code. Much of which you could easily figure out by simply adding a print out in the midst of the encoding/decoding loops and examine what happens when you try it. First, at line 51, you have `input[count] == 'z';` where it should …

Member Avatar for Jed_1
0
667
Member Avatar for chase.lewis.3114

First, let me introduce you to two extremely useful standard floating-point functions: [frexp](http://www.cplusplus.com/reference/cmath/frexp/) and [ldexp](http://www.cplusplus.com/reference/cmath/ldexp/). The first allows you to do a base-2 logarithm (integer result, rounded above). And the second allows you to multiply a floating-point number with 2 to some integer power (positive or negative), and it does …

Member Avatar for vijayan121
0
196
Member Avatar for BigPaw

I encountered a nice programming example of Schrödinger's cat. If you have this code: int main() { int a, b, c; a = 1; b = 2; c = a + b; cout << "value of c is " << c << endl; }; Then, the compiler is allowed to …

Member Avatar for pritaeas
0
189
Member Avatar for Plazmotech

My thoughts are that this framework you are describing is probably not going to take you very far, you will quickly hit a wall (or a number of walls). For one, it is obviously much too simplistic, as a typical game engine / framework would contain quite a lot more …

Member Avatar for mike_2000_17
0
229
Member Avatar for spyindiarahul

My signature-spam detectors are going off the charts here, or is it just me? Rahul and Izhar, you are walking a fine line. If you keep going, you might get infracted and banned, again. The rule states: **Keep It Spam-Free** **Do** ensure that all posts contain relevant content and substance …

Member Avatar for <M/>
-2
1K
Member Avatar for Reverend Jim

Windows 8 is full of security holes and backdoors, everyone knows that. Accessible to NSA and anyone else. What's the news here?

Member Avatar for jwenting
0
265
Member Avatar for somjit{}

TortoiseGit is nothing more than a GUI front-end to Git. I would not recommend that you rely on it for any advanced work, especially if you are having some trouble with your repo. You should use Git Bash, i.e., the command-line utility, because that will give you all the info …

Member Avatar for mike_2000_17
0
239
Member Avatar for Stuugie

Maybe you should try the follow [the official instructions first](http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html).

Member Avatar for mike_2000_17
0
272
Member Avatar for broj1

Just a thought. Wouldn't the time stamping have more to do with the server's time service, and not with any of Dani's code. Maybe the server had a glitch of some kind in its time service (a reset, or something).

Member Avatar for stultuske
1
906
Member Avatar for CCHIndiaStore

My politically correct answer: The best tool depends on the type of tasks and the requirements. Bla bla bla, the right programming language is the one best suited for the job at hand. Bla bla bla, mention a bunch of programming languages and their advantages to please each person's sensibilities. …

Member Avatar for mike_2000_17
-3
370

The End.