2,898 Posted Topics

Member Avatar for soche123

You are missing the curly braces in this for loop: for(int j=0; j<=years; j++) cout<<"Enter runs scored by player"<<":"<<i+1<<": "; cin>>record[i][j]; You'll see it better if you space it out and indent properly: for(int j = 0; j <= years; j++) cout << "Enter runs scored by player" << ":" …

Member Avatar for rubberman
0
1K
Member Avatar for mohanrachuri

In RPM-based systems (Fedora, Red Hat, etc.), you generally use the `yum` command: $ sudo yum install package_name (where `package_name` is the name of whatever package you want to install, not the file name, just the name) In Debian-based systems (Ubuntu, Debian, etc.), you generally use the `apt-get` command: $ …

Member Avatar for rubberman
0
149
Member Avatar for Sid_1

This all depends on how you want to install it. One option is to use a virtual machine, like VirtualBox. This will create one big file (that you place wherever you like) that is a kind of disk image. Basically, with this option, you can install Ubuntu (or any other …

Member Avatar for rubberman
0
336
Member Avatar for overflowh

I don't see anything wrong with this code. My guess is that it is not a problem with either the printing or the iterators "resetting". It's most likely a problem with the creation of those vectors. In other words, what is being printed is exactly what is in those vectors. …

Member Avatar for mike_2000_17
0
412
Member Avatar for FC Jamison

This is called a [Singleton](http://en.wikipedia.org/wiki/Singleton_pattern) class. The most straight-forward way to implement it in C++ is as follows: // in the header file: class MySingleton { private: // private constructor: MySingleton() { }; // private copy-constructor (left undefined): MySingleton(const MySingleton&); // private copy-assignment operator (left undefined): MySingleton& operator=(const MySingleton&); public: …

Member Avatar for rubberman
1
6K
Member Avatar for ??!!

> If you truly index by area then you have an array such that &array[area] is valid I think your definition of "indexing" is bit off of the conventional definition of the term. For one, the OP states "a search index", which is very explicit. But even without that precision, …

Member Avatar for mike_2000_17
-1
238
Member Avatar for <M/>
Member Avatar for lewashby

The trick to turn a single numeric character (digit) into an integer value is to simply subtract the value of the character `'0'` because it is almost certain (in all reasonable character sets) that digit characters have values that are sequential (e.g., in the ASCII table, the characters 0, 1, …

Member Avatar for vijayan121
0
231
Member Avatar for mgold

I think they serve very different purposes. I think that it is true that a lot of the wide-distribution applications for "light" work or for play are shifting towards web applications more and more. But that's because there are more and more people using the internet (duh!) and more companies …

Member Avatar for james.lu.75491856
0
454
Member Avatar for lewashby

The type `char arrayOnes[10];` is an array of 10 characters. In your initializer, you are defining an array of strings (which are themselves arrays of characters). This would be the correct version: const char* arrayOnes[10] = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; The above defines an …

Member Avatar for mike_2000_17
0
180
Member Avatar for Suzie999

This is by design. If you read the first thread on a forum, all the other threads are marked as read. I don't like this behavior either, but it is intentionally so (don't ask me why).

Member Avatar for Suzie999
0
281
Member Avatar for phorce

Do you really need a class? Computing the FFT seems more appropriate as a kind of function than a kind of class. And you can make the choice of input / output containers external to that function by using the established C++ practice of using generic iterators. For example, you …

Member Avatar for vijayan121
0
201
Member Avatar for Lp_baez

There might be a stray character on the input stream. Try to use `cin.ignore();` before the second input.

Member Avatar for Nutster
0
253
Member Avatar for arunkishorres

As simple as this: #include <iostream> // to print to console #include <fstream> // to read / write to a file #include <string> // to represent words (strings) int main() { std::ofstream output_file; output_file.open("test.txt"); // open a file for outputting to it. std::string data = "Hello World!"; // create some …

Member Avatar for arunkishorres
0
252
Member Avatar for game06

> should i start learning about hardware or software? You take on a project and you learn what you have to. In robotics, it's pretty much inevitable to have to have a well-rounded set of skills. Each piece of hardware (sensors, motors, servos, controllers, batteries, etc.) have their quirks, which …

Member Avatar for hiyoes
0
209
Member Avatar for hackoman96
Re: c++

The library you are looking for is [OpenCV](http://opencv.willowgarage.com/wiki/) (Open Computer Vision Library). It is used extensively in artificial intelligence / robotics applications for image processing tasks.

Member Avatar for mike_2000_17
0
170
Member Avatar for Banfa

It makes no difference whatsoever when it comes to global symbols. I tried the following source file: #include "header.h" #if 0 using company::module::ProjectConstants; const int ProjectConstants::CONSTANT1 = 10; const std::string ProjectConstants::CONSTANT2("Hello World"); #else namespace company { namespace module { const int ProjectConstants::CONSTANT1 = 10; const std::string ProjectConstants::CONSTANT2("Hello World"); }; }; …

Member Avatar for mike_2000_17
0
232
Member Avatar for oanahmed

Of course you don't have to ask for permission to give your opinion on something, whether on a public website or anywhere else. That's an essential part of the "free" in "free speech". You can speak about anything to anyone, express any opinion you want, and you can offend people …

Member Avatar for Ketsuekiame
0
463
Member Avatar for th3k1d

Any Linux distro is good for C++. The C / C++ languages are fundamental to Linux and GNU tools, not so much in Mac (C / Objective-C are the preferred language, and C++ is pretty terrible to use on Macs). Qt is also a great choice for Linux (and all …

Member Avatar for mike_2000_17
0
244
Member Avatar for adil.ghori

First, you need to use standard headers and only standard headers. The headers like `iostream.h` are pre-standard (before 1998), and should no longer be used, more the `.h` part (note: this is for standard headers only). The C-standard headers like `math.h` and `stdlib.h` must have the `.h` removed and a …

Member Avatar for adil.ghori
0
387
Member Avatar for mah300274

There isn't much point in delving into ICs unless you plan to mass produce. They are just electronic circuits made to be much smaller, far less energy-hungry and much cheaper to produce. If your interest is semi-conductor physics than that's one thing, but if your interest is electronics, do electronics, …

Member Avatar for mike_2000_17
0
176
Member Avatar for christinetom

Well, the most complete source for information on the pre-processor is the section on it in the [C++ standard document](http://isocpp.org/std/the-standard) (you can download the draft for free, almost identical to the actual thing). The section only has 11 pages (which is extremely short of a chapter of the standard). The …

Member Avatar for rubberman
0
190
Member Avatar for lewashby

you shouldn't use the `${}` evaluation for the variable in the for loop, at least, I never do. And the for loop will recognize the globbing too, so you shouldn't use the `ls` command. Try this: for i in ~/Pictures/Screenshot\ from*.png; do mv ${i} /home/garrett/Pictures/ScreenShots/ done

Member Avatar for mike_2000_17
0
160
Member Avatar for Antriksh_1

Many compilers have an "extension" to allow for zero-size arrays, I don't understand why, but they do. According to standard, this code should not compile. And those compilers that implement this zero-size array extension, end up producing a class with size of 0, as a quirk. In my opinion, this …

Member Avatar for mike_2000_17
0
243
Member Avatar for mahesh113

This is a case of [return-value-optimization](http://en.wikipedia.org/wiki/Return_value_optimization) (or RVO). This is one of the few cases (with copy elision) where the compiler is allowed to change the behavior of the code (by eliminating calls to copy constructors and destructors) for optimization purposes. In other words, never depend on a specific number …

Member Avatar for mike_2000_17
0
341
Member Avatar for Echo89

It seems a bit too convoluted. There is a standard (now) method for doing this. See [this example](http://www.boost.org/doc/libs/1_53_0/libs/bind/bind.html#with_boost_function) using Boost.Bind and Boost.Function. Both of these libraries are now part of the standard (C++11) in the [`<functional>` header](http://en.cppreference.com/w/cpp/utility/functional). You can basically implement your example like this: #include <iostream> #include <functional> #include …

Member Avatar for Echo89
0
243
Member Avatar for BigPaw

I haven't explored Chrome extensions all that much, but here are a few that I use and like: [Grammarly Lite](https://chrome.google.com/webstore/detail/grammarly-lite-smart-spel/kbfnbcaeplbcioakkpcpgfkobkghlhen) - "Smart" spellchecker. [Session Buddy](https://chrome.google.com/webstore/detail/session-buddy/edacconmaakjimmfgnblocblbcdcpbko) - This is an extension to manage sessions (a collection of open tabs). It is nice because if you have to close all browsers or …

Member Avatar for BigPaw
0
317
Member Avatar for Abhinisha

> what is the use of :: in them ?? A simple trick, just think of `Foo::Bar` as meaning "Bar from Foo". This meaning works everywhere you see those `::`. Like `std::cout` is "cout from std namespace". Or `MyClass::SomeFunction()` means "call SomeFunction() from MyClass". In fancy C++ terminology, the `::` …

Member Avatar for MonsieurPointer
0
211
Member Avatar for mah300274

What consumes most RAM (besides the browser) is the desktop environment as a whole. Ubuntu's latest versions that have Unity and all the latest bells and whistles that come with it is on the heavier side when it comes to Linux desktop environments. This definitely does not sound like something …

Member Avatar for iamthwee
0
901
Member Avatar for shane.shaffer.50

The database part is almost definitely better handled with a database engine. A reasonably good and cross-platform, and free one is [MySQL](https://en.wikipedia.org/wiki/MySQL). All database engines are setup in a server-client arrangement over a network (or loopback). And most GUI toolkits (I recommend Qt) have a number of pre-existing widgets to …

Member Avatar for iamthwee
0
209
Member Avatar for Labdabeta
Re: EOFs

What makes you think that there is supposed to be a sequence of characters at the end of a file that indicate that the file has reached the end? The EOF flag is artificial, it doesn't appear in the files. If you try to read / write to a file …

Member Avatar for Labdabeta
0
182
Member Avatar for hardmath

I have to agree with jwenting (that's a first!), cloud-based services of the likes of Google Docs are pretty much the biggest hole in internet security right now, and everyone is pushing to make it bigger. If you use them, limit your use to uploading files into a public dropbox …

Member Avatar for mike_2000_17
0
382
Member Avatar for CPT

First of all, if you don't need the AbstractClass beyond the scope of the constructor, then all you need to do is make the constructor templated: class FileWriter { ofstream file; public: template <class AbstractClass> FileWriter(const string& fileName, const AbstractClass& ab) { // must turn on io-exceptions, as the only …

Member Avatar for mike_2000_17
0
517
Member Avatar for subash sonar

> The 1980s weren't that great. Except for the invention of the Internet, the adoption of seatbelts, Michael Jackson, Knight Rider, and, of course, the invention of miniskirts. And the greatest miracle of them all, my birth ;) > Can it be possible to give the header file windows.h in …

Member Avatar for Moschops
0
358
Member Avatar for Vasthor

You're correct. The standard sort function will provide const objects to the comparison function. When calling a function with a const object as parameter, the function must take the object either by const-reference or by value. This is why changing the signature of the comparion function to non-const references does …

Member Avatar for mike_2000_17
0
273
Member Avatar for tooota

Simulation is a far too general term. What kind of simulation? What kind of system do you want to simulate? If you're talking about a dynamic system (i.e., differential equation of motion), then at the base all you need is some good numerical integrators library, then probably some linear algebra …

Member Avatar for tooota
0
224
Member Avatar for one-unicorn

For simple image manipulations like that, I find that the [FreeImage library](http://freeimage.sourceforge.net/) is pretty nice and easy. And it works well in Windows too.

Member Avatar for mike_2000_17
0
782
Member Avatar for yxBen

For one, you cannot overload operators for basic types like `int` or `double` or whatever, there must be at least one non-primitive type in the operator's signature. In this case, it is OK on that aspect because `ostream& os` is a non-primitive type. However, there already exists an `operator<<` for …

Member Avatar for yxBen
0
506
Member Avatar for mini programmer

I just tried it out. I have Kubuntu 12.10, with python installed (default) and with the mxDateTime and Mako installed as instructed by JasonHippy. I extracted the Haizea sources as instructed, I launched the setup.py as instructed, and received a message similar to yours (ending in "Writing ... haizea-1.0.egg-info"). All …

Member Avatar for mini programmer
0
1K
Member Avatar for christinetom

I don't know about file sizes specifically, but have you tried [Qt](http://qt.digia.com/)? It fits all your other criteria: easy to use, good RAD tool, and LGPL (or commercial) licensing. As for tnFox, I have never heard of it.

Member Avatar for christinetom
0
199
Member Avatar for soche123

According to the problem statement and according to the function declaration, what you should do is take the three numbers as input (cin) before calling the function, and then pass those three numbers to the function to get the result. As so: #include <iostream> #include <cmath> // <-- notice, the …

Member Avatar for mike_2000_17
0
157
Member Avatar for sanyam.mishra

> The solution is simple your programs won't work on anything but turbo c so your only choice is to carry on using it. Well, another solution is to make all the necessary changes to the code so that it works on a modern compiler. If the project is not …

Member Avatar for mike_2000_17
0
132
Member Avatar for IMPRESSIVE

Start by reading some reviews and picking a distribution that might be a good fit for you. For example, these [latest reviews](http://www.pcpro.co.uk/features/382288/best-linux-distros-for-2013), or [these](http://www.linux.com/news/software/applications/708977-the-2013-top-7-best-linux-distributions-for-you), or [these](http://www.linuxcircle.com/2013/03/28/top-10-linux-distros-for-desktop/). Also, you should know that often what matters most to a casual user is the eye-candy, i.e., the look and feel of the interface, …

Member Avatar for rubberman
-5
208
Member Avatar for tony75

The answers given by the OP are correct, that is, 1: B & D and 2: B. The explanation is as follows: 1) The Linux naming convention for hard-drives has the first two letters to identify the kind of hard-drive it is, usually "hd" for normal hard-drive and "sd" for …

Member Avatar for tony75
0
748
Member Avatar for triumphost

> So how can I distinquish the difference? In other words, how can I figure out which kind of `T**` they are passing? You can't. There is no difference between `T**` (pointing to an array of arrays) and `T**` (pointing to a pointer to a T variable) from a type …

Member Avatar for mike_2000_17
0
115
Member Avatar for sanyam.mishra

Normally, I would direct people either to the C++11 threading library or to its precursor, the Boost.Thread library, as the best, most portable and easiest multi-threading library to use. However, these will certainly not work with Turbo C++ 3.0. Your best chance is with the [Win32 API](http://msdn.microsoft.com/en-us/library/vstudio/bb384843.aspx) functions. To create …

Member Avatar for mike_2000_17
0
577
Member Avatar for Ancient Dragon

I think LibreOffice works OK for most practical purposes. I'm not sure how good their database program (LibreOffice Base) is though. I've used it a little bit, it seems fairly basic, but I have never used MS Access, so I have no basis for comparison. How do you find it …

Member Avatar for Ancient Dragon
0
332
Member Avatar for shadyreal

> The collision is only inside the model, ... > the normals on the model pointing out as it should be. ... > you can se inside it but not inside out ... > collision works great from the outside. ... > The collision is only intersecting the triangles inside …

Member Avatar for shadyreal
0
269
Member Avatar for new_developer

Well, for one, you must always turn on all the warnings (`-Wall`) when compiling your code, and most compilers will warn you when you are using uninitialized variables, or that a variable might be uninitialized at some point. If the type is not a trivial type (int, double, etc.., and …

Member Avatar for mike_2000_17
0
356
Member Avatar for NardCake

> we even get some very minimal traffic from North Korea. Just because people from North Korea may visit DaniWeb can't possibly mean that we have to uphold North Korean internet and privacy laws!! But it does mean that the site should be usable from a Windows 95 computer. ;)

Member Avatar for Zagga
0
217

The End.