This is a good tutorial on using rsync for backups.
Easy Automated Snapshot-Style Backups with Linux and Rsync
User Profile
Collapse
Profile Sidebar
Collapse
tyreld
Last Activity: Dec 30 '06, 10:37 PM
Joined: Sep 12 '06
Location:
-
-
Maybe you should post your problem code. That way people can walk you through the problems spots and then maybe you might learn something.Leave a comment:
-
Remove the getline between main and the first bracket.
Code:int main() { ... } INSTEAD OF int main() getline() { ... }
Leave a comment:
-
If you want to see how shared memory is implemented then go look at the Linux kernel source code. That is an excercise I leave up to you. However, I will warn you that it is not pretty, and probably not going to make sense unless you have a high level understanding of C programming and the implementation of the Linux kernel.
As far as using shared memory goes here is an incredibly simplistic client/server example using shared memory....Leave a comment:
-
Can you show us more code? Have you actually written the function that assigns the port numbers? You haven't given enough info for us to know what the exact problem you are having is.
One thing I have noticed is that you are using the enum identifier in your struct definition when you typedefed the enum definition to a standalone name. There is no type "enum port_numbers", but there is a type "port_numbe rs" that...Leave a comment:
-
I suspect you have misread iterative as recursive. The factorial function is currently implemented recursively. Changing it to a loop (ie. iterative implementation) would make it faster. Leaving you both in agreement. ;)...Leave a comment:
-
You need to tell jar what to include.
jar -cmf mf.txt post.jar post/*...Leave a comment:
-
The value of a pointer is an address. The expression "&a" evaluates to a value which is an address. So, in your example: at runtime the values of "&a" and "&b" are first evaluated before being passed to the function. The address values are then copied into the pointers "x" and "y" in the stack frame allocated for the "swap" function. The pass by semantics have to do with the...Leave a comment:
-
-
You can't. You need the ".h" or ".cpp" file that contains the class definition you want to inheiret from just to compile your existing code into an object file.Leave a comment:
-
I know you said simulated, and I know of many poorly worded examples on the internet that I suspect you conjured this example from. This simulates nothing. You are explicitly passing addresses (&a must be evaluated before the function call can take place since the address must be copied into the stack value for x) and then dereferencing them in the callee. This is nothing more then short cutting. I will also point out in formal language semantics...Leave a comment:
-
Using "sprintf" is a poor choice as it can overrun the provided string buffer if you are careless. Using functions that allow you to control the the size of input copied into a buffer is always the best coding practice. In this case "snprintf" is a better choice....Leave a comment:
-
You can use "snprintf" to accomplish this.
int snprintf(char *str, size_t size, const char *format, ...);Upon successful return, this function returns the number of characters printed (not including the trailing '\0' used to end output to strings). The function snprintf() does not write more than size characters (including the trailing '\0'). If the output was truncated due to this limit then the return value is the...Leave a comment:
-
Please be more specific. Are you wanting to see the actual library implementation of the "shmget" function, or are you wanting an example of how to write code that utilizes shared memory? Shared memory is not exactly a cake walk. In particular you usually need to utilze semaphores to synchronize access to the shared memory segment.Leave a comment:
-
Your function prototypes have to match your function declarations. In the code you posted you have neglected to include the reference operator "&" in your parameter lists.Leave a comment:
-
If you are trying to create a table of the number of payments like you have outlined in the problem description I would recommend using a loop. Fill in the psuedo code with with real code. I've probably provided you with a bit more then I should.
Code:int month = 0; cout << "MONTH \t PRINCIPLE \t INTEREST \t PAYMENT" << endl; while (LOAN NOT PAID OFF) { INCREMENT MONTH;
Leave a comment:
-
What exactly does the compiler complain about? The actual compiler message would be helpful in determining what might be the problem. Have you told the compiler where to find the include file? If it isn't in the working directory or the default include path it won't be found.Leave a comment:
-
Interesting problem. Have you tried to solve it yourself? You will be more likely to get a response if you try to solve this and then post particular questions about specific things you are stuck on or having problems with.Leave a comment:
-
Everything in C is passed by value. This means pointers as well. With this in mind lets not forget what the value of a pointer is. The value of a pointer is simply the memory address where we have stored something else (ie. an int value, or a float value, or even a pointer to something else).
Now an example.
Code:#include <stdio.h> void foo(int *f_ptr) { int x = 10;
Leave a comment:
No activity results to display
Show More
Leave a comment: