Search:

Type: Posts; User: ArcadeEdge

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    25,452

    Yes I did and I've looked at several examples but...

    Yes I did and I've looked at several examples but it just didn't seem to clear to me. What I got from my search is that alarm() will decrement and then send a signal to do whatever the function says....
  2. Replies
    4
    Views
    25,452

    Using alarm() and other signals.

    So I'm having a hard time trying to figure out how alarm() works.
    Let's say I wanted to make a distance meter that decrements every 1 second and every 3 seconds an update will be printed out.

    My...
  3. Sorry. Okay, I got rid of the for loop and now...

    Sorry.

    Okay, I got rid of the for loop and now have



    spawn = fork();
    if(spawn > 0) spawn = fork();
    if(spawn > 0) spawn = fork();
  4. Thanks for the reply. I've been using ps -eaf in...

    Thanks for the reply.
    I've been using ps -eaf in the terminal to view the processes and after looking at things a little more closely, I see what I'm doing now. Though, there is still one child...
  5. I also tried fork(); fork(); I got the...

    I also tried

    fork();
    fork();

    I got the same result as above.
    3 children process with two being children of the parent and one being the child of one of the the two childrens
  6. Multiple processes from one Parent using fork() in C

    So I'm trying to write this program that requires only the parent to fork multiple process that will all do the same time.

    I am able to generate 3 processes, but only two are from the parent and...
  7. Replies
    6
    Views
    5,408

    I have another question with qsort and the...

    I have another question with qsort and the compare function.
    I know I can make two compare functions that will sort in ascending and descending order. Is there a way to make it conditional so I can...
  8. Replies
    6
    Views
    5,408

    Thank you all so much. I was working on this last...

    Thank you all so much. I was working on this last night and it's been a long, long weekend. Haha.
    I'm also not very strong with pointers and structures, thus why I am doing this little project.
  9. Replies
    6
    Views
    5,408

    qsort not sorting structs

    Okay, so all I'm trying to do is use qsort to sort integers in a structure.
    It runs and compiles but doesn't sort. Instead it sets the first 3 ages to 0 and does nothing with the rest. I'm guessing...
  10. Replies
    18
    Views
    22,053

    omgosh. Thank you so much! I knew it had to do...

    omgosh. Thank you so much! I knew it had to do something with my allocation and I understand why now.
  11. Replies
    18
    Views
    22,053

    #include #include #pragma...

    #include <stdio.h>
    #include <stdlib.h>
    #pragma pack(1)

    struct BitMap
    {
    unsigned short int Type;
    unsigned int Size;
    unsigned short int Reserved1, Reserved2;
    unsigned int Offset;
  12. Replies
    18
    Views
    22,053

    Thank you. I fixed that but it's still crashing...

    Thank you. I fixed that but it's still crashing when reading in the pixels.

    It crashes when trying to read the 15th row.



    printf("\nReading Pixels Info...\n");
    for(i=0; i <...
  13. Replies
    18
    Views
    22,053

    Thanks oogabooga. That worked! I'm on Windows...

    Thanks oogabooga. That worked! I'm on Windows compiling with GCC.

    I can get it working for files no larger than 12x12 but still have trouble with freeing the memory.
  14. Replies
    18
    Views
    22,053

    Thank you so much for you help quzah. I really...

    Thank you so much for you help quzah. I really appreciate it!

    When I run the program, it crashes, but if I execute it right after, everything seems to work when I'm testing my 5x5 file.

    With my...
  15. Replies
    18
    Views
    22,053

    I'm still getting the same results...

    I'm still getting the same results...
  16. Replies
    18
    Views
    22,053

    Thank you for your replies. I've been working on...

    Thank you for your replies. I've been working on it and it seems to be reading in the pixel (most of the time). I'm now trying to figure out why it's not reading some of the pixel and how to save the...
  17. Replies
    18
    Views
    22,053

    But the instructions my professor gave us is to...

    But the instructions my professor gave us is to store that data into a 2d array. Would I have to use a pointer to the structure, allocate it, then read the data using the pointer?
  18. Replies
    18
    Views
    22,053

    Reading 24 bit BMP file into a 2d array.

    I'm a bit stuck. I am able to read the information for the file and display that but I'm a bit confused on how to read each pixel into an array.

    The exact instructions are to read in the pixel...
  19. Thank you anduril, I will try that but is there...

    Thank you anduril, I will try that but is there any way I can print the address in decimal or do I have to use %p?
  20. I haven't looked at the other replies in detail...

    I haven't looked at the other replies in detail yet, but @anduril462



    Well, it's part of an assignment where I have to print the address at every 8th byte starting from the beginning of the...
  21. Pointers and addresses (warning when trying to print the address)

    So my problem is that I get this message when I try to print the address (in decimal) of where the pointer points to.

    "warning: format '%d' expects type 'int', but argument 2 has type 'char *' "
    ...
  22. I have another question. What if I wanted to...

    I have another question.

    What if I wanted to check for capital letters too?
    Can I subtract 32 (dec) from each element in TEST? So I will get the capital letter ascii value?

    for example:

    ...
  23. Thank you! Your solution works perfectly! I was...

    Thank you! Your solution works perfectly!
    I was over thinking it, thinking I had to compare each character and if doesn't match, throw away the word.
  24. Multidimensional string arrays and comparing characters

    I'm trying to read in a file and find words that ONLY contain certain characters. For example, I want to find words that only have "ats" so "bats" or "cats" would be invalid but "ats", "stats", "sat"...
  25. Replies
    8
    Views
    2,493

    Okay. But how would I take care of the overflow?...

    Okay. But how would I take care of the overflow? The extra characters seem to overwrite name?
    Is it because it loops and asks for a new name but then the extra characters are still floating out...
Results 1 to 25 of 37
Page 1 of 2 1 2