User Profile

Collapse

Profile Sidebar

Collapse
tyreld
tyreld
Last Activity: Dec 30 '06, 10:37 PM
Joined: Sep 12 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • tyreld
    replied to incremental backup help
    This is a good tutorial on using rsync for backups.

    Easy Automated Snapshot-Style Backups with Linux and Rsync
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to C++ reading data from file into array
    in C
    Please don't double post.

    What does your output look like?
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to Too much Java to memorize
    in Java
    Maybe you should post your problem code. That way people can walk you through the problems spots and then maybe you might learn something.
    See more | Go to post

    Leave a comment:


  • Remove the getline between main and the first bracket.

    Code:
    int main()
    {
    ...
    }
    
    INSTEAD OF
    
    int main()
    
    getline()
    {
    ...
    }
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to plz get me the code for shmget() in shared memory
    in C
    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....
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to enum type usage
    in C
    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...
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to Please Help with e^x estimating program
    in C
    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. ;)...
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to creating jar files
    in Java
    You need to tell jar what to include.

    jar -cmf mf.txt post.jar post/*...
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to pass by reference in c----help banfa
    in C
    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...
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to How do i convert a float to string?
    in C
    I think that it is defined as "_snprintf" on windows.
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to C++ shared objects
    in C
    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.
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to pass by reference in c----help banfa
    in C
    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...
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to How do i convert a float to string?
    in C
    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....
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to How do i convert a float to string?
    in C
    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...
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to plz get me the code for shmget() in shared memory
    in C
    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.
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to How to pass parameter or call a function?
    in C
    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.
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to Loan Payoff Table Help
    in C
    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;
    ...
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to C++ shared objects
    in C
    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.
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to plzz help, give me d solution..
    in C
    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.
    See more | Go to post

    Leave a comment:


  • tyreld
    replied to pass by reference in c----help banfa
    in C
    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;
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...