2,898 Posted Topics

Member Avatar for skyyadav

the function `stoi` does not exist. The function you probably meant to use is `atoi`. And you need to include the `<cstdlib>` for that one.

Member Avatar for Kanoisa
0
1K
Member Avatar for raviragarwal292

If you want to play youtube videos in the browser, you need to [install flash-plugin](http://fedoraproject.org/wiki/Flash). To download youtube videos, you can use the `youtube-dl` program. As so: $ sudo yum install youtube-dl which is a command-line program to download youtube videos. [See docs here](http://rg3.github.io/youtube-dl/documentation.html).

Member Avatar for L7Sqr
0
131
Member Avatar for strongard63

I just replied. I initially thought that nullptr would come back around to answer. > **why** I do not get answer to my question??? That can vary. Sometimes the post is just too long. Sometimes you don't get the feeling that the original poster is really pull his weight (not …

Member Avatar for strongard63
0
214
Member Avatar for sarah.mathieson.7

You should call the constructor of Date in your initialization list, and you can pass it the three integers you get in the Person constructor: Person(const char * their_name, const char * email, int aDay, int aMonth, int aYear) : Date(aDay, aMonth, aYear), name(0), email_address(0) { name = new char[strlen(their_name) …

Member Avatar for mike_2000_17
0
265
Member Avatar for gabrielomar22

This forum uses English only. Please restate your question in English. It is against the rules to post in another language, so this is a warning.

Member Avatar for rubberman
0
61
Member Avatar for H_beginner

You have a typo on line 78, in your constructor, you have `setz(yin);` when it should be `setz(zin);`.

Member Avatar for H_beginner
0
420
Member Avatar for glao

Do you know [calculus](http://www.math.hmc.edu/calculus/tutorials/odes/)? If you have a first-order differential equation like this: dN/dt = -l * N(t) You get the following analytical solution: N(t) = N(t0) * exp(-l*t) Here's how you get it: 1) Separate the variables: dN / N(t) = -l * dt 2) Take the integral of …

Member Avatar for glao
0
656
Member Avatar for vdhyasri

My guess is that if you try to compile this with a C++ compiler, it will work just fine. So, why do you need to convert it further? (btw, I have my suspicions, I'm no fool) In any case, you need to show that you tried something. We will not …

Member Avatar for mike_2000_17
0
177
Member Avatar for furalise

The `FILE*` way of reading from a file is just the legacy that was inherited from C. The C++ language was developed with the aim of largely keeping compatibility with C (i.e., C is nearly a subset of C++, with only minor incompatibilities). This means that the entire C standard …

Member Avatar for furalise
0
844
Member Avatar for HoverportMedia

Can you clarify what you mean by "violating the DMCA"? Can you provide some examples of search hits that direct to such "violations"? I really don't understand exactly what you are referring to. And also, the internet is full of "questionable" content, so I would expect that any decent and …

Member Avatar for jwenting
0
405
Member Avatar for mixelplik

First of all, from your algorithm, it seems that the array is sorted from greatest value to lowest value, right? Otherwise your `if(array[middle] > value)` has the wrong `<` / `>` sign. What seems bizarre with your binary-search algorithm is that it doesn't seem to allow for or detect the …

Member Avatar for mixelplik
0
1K
Member Avatar for Ketsuekiame

Yeah, I had noticed that a while back. Me and some others have talked about it on the initial "bug thread" for the new interface. I guess this may be a forgotten item on Dani's todo list. Thanks for the reminder.

Member Avatar for Ketsuekiame
1
247
Member Avatar for skyyadav

Think of it this way. The steps you need to perform are as follows: 1) Copy the sequence. 2) Iterate through the sequence: 2-1) Replace the element value `x` by `f(x)`. 3) Return the modified sequence. The first step is already done, because the sequence `c` is passed by value, …

Member Avatar for mike_2000_17
0
414
Member Avatar for pardeepkhatri

Why do you want to install a windows program onto Linux? Chances are, there is a Linux version of the software or an equivalent application for Linux. What is the software itself? Maybe we can suggest a Linux equivalent.

Member Avatar for praom2104
0
393
Member Avatar for lewashby

Go in the bios menu, and disable the "secure boot". It is a Microsoft-controlled "feature" to boot only "approved" operating systems, in other words, it's to prevent you from not using the Windows installation that came with the computer. The good news is, you can disable it, it's required by …

Member Avatar for rubberman
0
103
Member Avatar for SakuraCindy

There was a similar thread not too long ago. You might want to give it a read: [Need help with university scheduling using Genetic Algorithm](http://www.daniweb.com/software-development/computer-science/threads/461962/need-help-with-university-scheduling-using-genetic-algorithm) I can't really say much more than what I explained in that thread. And, of course, I agree with gusano79, the tricky part is coming …

Member Avatar for SakuraCindy
0
153
Member Avatar for nizam27391

> How to evaluate that the timetable is the most effective. Any idea? Well, you described your problem as a "smart scheduler". So, you must have some idea of the difference between a schedule produced by a stupid scheduler and one produced by a smart one. But, to create a …

Member Avatar for SakuraCindy
0
381
Member Avatar for skyyadav

[This](http://www.cplusplus.com/reference/iterator/ostream_iterator/) should give you a pretty good hint.

Member Avatar for mike_2000_17
0
194
Member Avatar for Stuugie

> How many use it on Linux I've never used it. I keep Windows around on a dual-boot. And the only things that I cannot get in Linux are things I wouldn't try to run in Wine, or not worth the effort. Mostly, I use Windows for either computer games …

Member Avatar for Stuugie
0
340
Member Avatar for devourer17

The search algorithm is pretty trivial, that's why you always get back to the "Binary Search Tree". Once you have a binary search tree constructed, searching for a particular element or range is a simple matter of recursively going down the branch which should contain the sought-after value depending on …

Member Avatar for mike_2000_17
0
155
Member Avatar for jimmyovid

"Who can solve this algorithm?" Hmmm... **you** maybe? Usually, when you get an assignment to do, it is because it is something that **you** could benefit from doing **yourself**. We don't provide ready-made answers to assignment questions here, because it helps no-one to do so. And, we aren't tricked that …

Member Avatar for deceptikon
-1
248
Member Avatar for reverend818

> using methods which would be difficult (though perhaps not impossible) in C++. .... > This specific approach won't work in C++, as it relies on the ability to generate new functions programmatically. Is that some kind of a joke? Or maybe you're taunting me? The code you posted is …

Member Avatar for mike_2000_17
0
390
Member Avatar for Assembly Guy

I think it's just a matter of you having fairly low counts and that you've had quite a bit of activity in the past week or so (lots of posts, and several "post comments" with reputation points associated). This can make your rank jump quite a lot. It's all relative. …

Member Avatar for Assembly Guy
0
151
Member Avatar for strongard63

Well, `125 / 10 = 12`, because this is using integer arithmetic. So, because the type of `x` is `int` (i.e., cannot represent floating-point numbers), then, the meaning of `x / 10` is that the value of `x` is divided by 10, but the remainder is discarded. The remainder is …

Member Avatar for strongard63
0
2K
Member Avatar for Daneil

The same is true for line 32. Both loops are infinite do-nothing loops. I'm not sure what you tried to do, I can't really understand what's going on.

Member Avatar for Lerner
0
226
Member Avatar for GrimJack

I guess I'll just share a few of my own eclectic obsessions too: [Frankie Yankovic](http://www.youtube.com/watch?v=RN_VwMb8m2M) ("America's Polka King") [Manu Chao](http://www.youtube.com/watch?v=vJMLJVha5sw) [Scandinavian Music Group](http://www.youtube.com/watch?v=AMnqTTCGmdI) (it's in Finnish) [Radio Radio](http://www.youtube.com/watch?v=IqfSoDG1C3g) (the language is [Chiac](http://en.wikipedia.org/wiki/Chiac), if you're wondering) [Gnarls Barkley](http://www.youtube.com/watch?v=u_R9fId_Rqo) Carolina Chocolate Drops ([Jig](http://www.youtube.com/watch?v=nliiRDmBbEQ) or [Folk](http://www.youtube.com/watch?v=gk62UAM7Hpk)) A few French-canadian stuff too (I have …

Member Avatar for ddanbe
0
460
Member Avatar for jvasher

The problem is coming from the fact that you delete the `terrain` pointer in the destructor, but that pointer points nowhere, i.e., you have not created an object to which it points to using the `new` operator. You can only call `delete` on pointers that point to memory allocated with …

Member Avatar for mike_2000_17
0
185
Member Avatar for aVar++

Just a crazy thought. Why not just enforce international law? Arrest Asad and his high command for war crimes, and put them on trial. Maybe I'm crazy, but I think that could be the best course of action.

Member Avatar for HiHe
3
2K
Member Avatar for Sockoiid

First thing's first, did you notice the update on the instruction website: quote: **Update 2**: the installer now requires you accept the Oracle license **before** the installation begins. This is only required once. If for some reason you need the installation to be automated, you can run the following command …

Member Avatar for iLikePHP
0
425
Member Avatar for somjit{}

I guess modern is relative, if you are used to using `vi`, `vim` or `emacs` for all your coding needs (as many many people do), then, in comparison, sublime-text looks like an ultra-futuristic spaceship (not Xenu's spaceship that "looks exactly like a DC-8"). I tend to prefer when applications stick …

Member Avatar for somjit{}
0
263
Member Avatar for Masood_786

Let me get this straight. You want to demodulate IF signals digitally from a Windows PC? Isn't this sort of insane? IF signals are usually around 20 to 100 MHz in frequency, depending on application, meaning that your analog-digital converter would have to run at about an order of magnitude …

Member Avatar for abbott@lantic
0
989
Member Avatar for Dani
Member Avatar for Stuugie
2
358
Member Avatar for happygeek

This looks suspicious: > 1.5 million new lines of COBOL code are written every day > 5 billion lines of new COBOL code are developed every year If I know math correctly, I would say that 1.5 million times 365 days is only about 550 million, i.e., about 10 times …

Member Avatar for happygeek
0
3K
Member Avatar for skyyadav

First of all, it is far simpler than it looks. The first thing I will point out is that if you need a local copy of the string, then you should take that string by value (instead of const-reference), it is preferrable in general to do so, and it also …

Member Avatar for mike_2000_17
0
1K
Member Avatar for Dani

I have a number of tutorials that are partially complete, as I've had trouble finding the time to complete them. But now, I've started to teach tutorials on C++ at my university, so, I must "produce" now. So, you'll probably see a few tutorials from me soon. ;)

Member Avatar for Dani
1
237
Member Avatar for Labdabeta

It is not because the debugger tells you that the error is at that line that it necessarily is exactly that line which causes the problem. What is the broader context of that line? Could it be within a member function of a class? Maybe the function is called on …

Member Avatar for rubberman
0
306
Member Avatar for cambalinho

> but in these case i belive that i can't use the 'const':( That's right, you can't use a constant because `std::endl` is actually a free-function which gets implicitely converted to a function pointer, and then, within the stream's `<<` operator, it is called on the stream. Anyways, long story …

Member Avatar for cambalinho
0
249
Member Avatar for Ancient Dragon

I haven't used DVD-rippers in a while. But a few years back, before I temporarily moved to Europe, I had a bunch of DVDs, bought in Canada. I could have brought them all with me (as a disk stack), but even then, I could not watch them, since my only …

Member Avatar for Reverend Jim
0
411
Member Avatar for null_pointer

Just use [Boost.Asio](http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/tutorial.html) (C++). Or, just use the POSIX functions in C / C++. It's not hard to do some UDP communication, a few lines of code, no more, and it's very intuitive. [See this tutorial](http://www.linuxhowtos.org/C_C++/socket.htm).

Member Avatar for mike_2000_17
0
192
Member Avatar for rookieNeedsHelp

I tend to go for the `stringstream` class instead, because it is more "C++-style" and it has more options in terms of formatted input. For a simple string-to-int mechanism, I would just do: std::stringstream(MovieRecord->getMinutes()) >> totalMins; Or, in two steps: std::stringstream ss(MovieRecord->getMinutes()); ss >> totalMins; This is also nice because …

Member Avatar for rookieNeedsHelp
0
263
Member Avatar for Stpdoug

You should also remove the `using namespace std;` from your header files. [It is not acceptable to have using statements in header files](http://www.lonecpluspluscoder.com/2012/09/i-dont-want-to-see-another-using-namespace-xxx-in-a-header-file-ever-again/). This is a rule to which there are no exceptions, period. You need to use `std::` for each standard library component you use in your headers.

Member Avatar for UFOOOOOOOOOOO
0
358
Member Avatar for abhimanipal

Where is your implementation of the constructor of Array, specifically the constructor that takes one argument? The compiler is telling you it cannot find it, neither can I from the code you showed. Your NumericArray constructor requires the definition of the Array constructor, which is missing, apparently.

Member Avatar for abhimanipal
0
253
Member Avatar for cambalinho
Member Avatar for cambalinho
0
140
Member Avatar for cambalinho

The reality is that there are limits to what you can achieve using the combination of implicit conversion operator and the assignment operator. You will not be able to make the "property" look like the actual value (i.e., make a property variable look like a normal variable but have hidden …

Member Avatar for cambalinho
0
334
Member Avatar for cambalinho

If I have a number like `13`, its binary representation is `1101` (i.e., `13 = 8 + 4 + 1 = 1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0`). If I do a bitshift of the number to the left by one bit, …

Member Avatar for cambalinho
0
391
Member Avatar for Chinthanie

> is there a possibility to write such a common compiler? Most compilers out there are written as a front-end and back-end duo. The front-end takes care of parsing the language, applying syntax rules and converting all the code into a simpler kind of code (usually something close to the …

Member Avatar for Chinthanie
0
114
Member Avatar for DeanMSands3

It seems to me that Qt has pretty much "won" at this point. Occasionally, people will mention that wxWidget is a bit more light-weight or something like that, but for the most part, it seems that cross-platform GUI development is dominated by Qt now.

Member Avatar for mike_2000_17
0
167
Member Avatar for Suzie999

For the compiler to be able to inline a function, it must see its definition (implementation). This means you cannot do the classic "declaration in header" / "definition in cpp file" paradigm. The definition must be in the header file. Marking the function as `inline` or `__forceinline` tells the compiler …

Member Avatar for Suzie999
0
1K
Member Avatar for kyle.mace.35

If you cannot use the C++11 swap functions, your best bet is probably to use the filebufs directly and construct vanilla `istream` / `ostream` objects from them. Something like this: class my_ofstream : public std::ostream { private: std::string filename; std::filebuf* pfb; public: my_ofstream(const std::string& aFilename) : std::ostream( new std::filebuf(aFilename.c_str()) ), …

Member Avatar for kyle.mace.35
0
197
Member Avatar for kyle.mace.35

You cannot peek for more than one character. However, you can use the `tellg` and `seekg` functions to restore the original position after having done a multi-character reading. As so: int peek_int(std::istream& in) { std::streampos orig_pos = in.tellg(); int result = 0; in >> result; in.seekg(orig_pos); return result; };

Member Avatar for mike_2000_17
0
293

The End.