Search:

Type: Posts; User: rmetcalf

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,561

    Well, first a for loop is contructed with three...

    Well, first a for loop is contructed with three parts like so:

    for(x = 0; x < 100; ++ x)

    in your loop it appears that the value of "shift" never changes and the break condition is really...
  2. Replies
    3
    Views
    1,561

    Why are you making this so complicated?

    Why are you making this so complicated?
  3. Replies
    7
    Views
    1,534

    There seems to be a lot of questions about linked...

    There seems to be a lot of questions about linked lists on this board. This is how I approach them.

    First, in order to simplify the explanation I am going to use a very simple structure.
    It will...
  4. All of the above is correct. As far as the offer...

    All of the above is correct. As far as the offer goes it's the total amount still available divided by the number of cases remaining plus a little bit for incentive.

    Ex 1:

    Lets say there are...
  5. Replies
    4
    Views
    2,888

    Here's how I do it. I load a string with the...

    Here's how I do it. I load a string with the entire command and pass it to the system call.

    sprintf(sysstr,"program_name %d",variable);
    system(sysstr);
  6. Replies
    9
    Views
    12,607

    You have another problem in getdata(). When you...

    You have another problem in getdata(). When you read the entire file to get a line count the file pointer stops at EOF and remains there. In order to load your structure array you must call either:
    ...
  7. Replies
    25
    Views
    5,558

    Have you ever though of using the shared memory...

    Have you ever though of using the shared memory functions that are part of IPC from Unix SVR4?

    Take a look at this:

    http://www.cs.cf.ac.uk/Dave/C/node27.html
  8. Replies
    4
    Views
    1,036

    In addition to all the points made by Master5001,...

    In addition to all the points made by Master5001, I can tell you one reason it won't work. You're not passing the var "count" into the functions as a pointer, so when you increment it in your...
  9. Replies
    8
    Views
    1,648

    These types of things are interesting. Look at...

    These types of things are interesting. Look at this table:

    (0 represents space or padding)

    000010000
    000232000
    003454300
    045676540
    567898765
  10. Replies
    8
    Views
    4,780

    10 is the ascii value for a newline '\n' When...

    10 is the ascii value for a newline '\n'

    When you hit enter a newline is appended to the buffer.

    fgets then appends a null to terminate the string.

    You are processing the newline as part of...
  11. I don't know if this would help, but have you...

    I don't know if this would help, but have you thought of using IPC
    (inter process communication) messaging.
    I use it for communication between a database engine and applications.

    Here is a URL...
  12. Replies
    8
    Views
    1,855

    Your imput buffer (line) has no memory allocated...

    Your imput buffer (line) has no memory allocated for it. The best way is to declare line like:

    char line[1024];

    That will allow up to 1023 bytes of input.


    The segmetation fault is caused...
  13. Replies
    6
    Views
    1,940

    Mats is right. I have found that the best use for...

    Mats is right. I have found that the best use for signals is when you need a program to behave in a specific way without human intervention, such as forcing a timeout. The setup is somewhat...
  14. Replies
    4
    Views
    3,402

    On output only. Let's say x = 12; ...

    On output only. Let's say x = 12;

    printf("%d",x) produces 12;
    printf("%04d",x) produces 0012;

    The leading 0 will pad the output.
  15. Replies
    2
    Views
    2,476

    First, let me say that this information is going...

    First, let me say that this information is going to stored in a simple array. If you were taklking
    about a large amount of data a binary tree (tsearch) would offer much better performance at
    the...
  16. Replies
    6
    Views
    2,602

    The problem is that you have two "main"...

    The problem is that you have two "main" functions. The main function is always the entry point and you can only have one. There are three solutions.

    First change the second program to a function....
  17. Replies
    11
    Views
    4,630

    Your loop will work as well, and actually is more...

    Your loop will work as well, and actually is more elegant.
  18. Replies
    11
    Views
    4,630

    Let's start from the beginning. The issue is that...

    Let's start from the beginning. The issue is that when presented with a string we want to convert lower case letters to uppercase letters without effecting any other charactor types.

    This means:
    ...
  19. Replies
    11
    Views
    4,630

    It only converts it if it is NOT equal to zero

    It only converts it if it is NOT equal to zero
  20. Replies
    11
    Views
    4,630

    You should use "islower()". Remember, these...

    You should use "islower()". Remember, these charactor type functions return NON-ZERO for true. So you could do:

    if(islower(c) != 0)
    x = toupper(c);
  21. Replies
    2
    Views
    838

    Linked List

    Since a linked list is only defined by each nodes embedded pointer what you need to do is create a double linked list. Each node must contain a pointer to the previous node as well as the next one....
Results 1 to 21 of 21