Take a look at rsync. There are a few front-ends (grsync, for one). I use it to back up all of my machines to an external HDD, and to my fileserver over the network.
Type: Posts; User: Mostly Harmless
Take a look at rsync. There are a few front-ends (grsync, for one). I use it to back up all of my machines to an external HDD, and to my fileserver over the network.
FYI, NTFS doesn't use a FAT, it uses a MFT.
Have you tried running this code? There are some issues you need to fix:
main() always returns an int.
You need a name qualifier for your iostream objects (std::cin, etc.).
You initialize...
You could also use a vector with std::random_shuffle(), but that takes the fun out of things.
I think you're overcomplicating it by trying to implement two things at the same time without having a firm grasp on either. Write a Car class that can only handle one car at a time. Then implement a...
If you're going to copy and paste my code, at least read the comments I put in, then maybe remove them. O.o
A few small things quickly, because it's after 2am here, and I don't want to say anything stupid. ;)
The class attributes should be private, not protected (as stated in the specs).
You...
You beat me to my reply. ;-)
To instantiate and object means to create an instance of that object. That is, you can't use Carpet directly. Think of Carpet as any other data type, like an int...
It's a start. A few general things before I get to the problem at hand:
#include <iostream>, not <stdio.h>. stdio.h is the C standard I/O library.
You forgot a closing bracket at the end of the...
The links g4j31a5 are what you need. That's how and where you start.
Break down the assignment into steps:
1) Create a structure named Carpet
2) that has two public data members: lengthInFeet...
I'm trying to figure out an efficient way of implementing a graph, and I'm not sure how to go about it. More specifically, say I have five members (vertices) whose edges are as follows:
A - B
B...
I have a struct, point, which stores (x, y) coordinates. I've created a map, point_map, to hold 256 points. What I need to do is ensure that no two points are the same. The code I've written works,...
Oops. Should have copied and pasted rather than typed it. Here's the broken code as it stands (I made the array smaller for brevity):
#include <iostream>
#include <string>
#include <fstream>...
The following code works when I keep the class outside of main(), but if I define the class in main(), I get the error: error: no matching function for call to ‘sort(main()::student [10],...
The flow of a C++ program isn't to start at the top and work your way down. The program starts (and usually ends) in the main() function. That means that if you want something done after you print...
I'm assuming, then, that I couldn't convince std::sort() to do the job on a vector of B*?
That works great, but I need the queue to hold type B*, not B, so:
std::priority_queue<A<std::string>::B*>
The problem is, I still need it to sort using operator< (or B::weight). How would I go...
I'm looking to create a priority_queue with the vector created in main() using B::weight to order the queue. How might I go about doing that?
#include <vector>
#include <string>
template...
After reading this, then looking at my code, I realized how wrong my original design was. It's great how a tiny change in perspective can make everything fall into place. Thanks for the insight.
In the following code, I want main() to have access to some data that it doesn't (and shouldn't) have access to:
#include <vector>
using namespace std;
template <typename T>
class A
{...
Ah, works like a charm. Thank you.
Any ideas about the last part?
I've got a bit of code that looks something like this:
template <typename T>
class A
{
private:
class B
{
public:
B() { count = 0 }
I agree with using the variable names in the function prototypes. It certainly makes the code easier to understand.
I almost asked about dynamically creating vectors in my original question,...
I have a bit of code that I'm having some trouble with. It looks something like this (I broke it down to make it short and sweet):
#include <vector>
#include <string>
class MyClass
{...
How would you implement a list composed of different types in C++, similar to Python's lists?
For example:
a = [3.14, "banana", 12, ["another list", 42]]