Search:

Type: Posts; User: CMakesMeSad :(

Search: Search took 0.00 seconds.

  1. Replies
    23
    Views
    3,447

    Thats kind of what I want it do. Lets say input...

    Thats kind of what I want it do. Lets say input the following 4 messages:
    1 5 message1
    5 10 message2
    1 6 message3
    2 7 message4

    The first number being the priority, I want to be able to list...
  2. Replies
    23
    Views
    3,447

    Hey everyone, Ive been working on this all day...

    Hey everyone, Ive been working on this all day and have made some good progress, however Im stuck again. Im working on the option of listing the messages by priority. However, no matter what priority...
  3. Replies
    23
    Views
    3,447

    the value of postion is -1 which makes absolutely...

    the value of postion is -1 which makes absolutely no sense. ill have to do something about this, thanks :)
  4. Replies
    23
    Views
    3,447

    Ah sorry, it was originally: scanf("%d",...

    Ah sorry, it was originally:


    scanf("%d", &messages[position].priority);


    I did take your advice the first time, i was just messing around with different things since I couldnt even get...
  5. Replies
    23
    Views
    3,447

    sorry guys, heres what i have now #include...

    sorry guys, heres what i have now


    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    struct MSG {
    int priority;
    int destination;
  6. Replies
    23
    Views
    3,447

    Thanks, Ill definitely look into it!

    Thanks, Ill definitely look into it!
  7. Replies
    23
    Views
    3,447

    I removed everything and just put this: ...

    I removed everything and just put this:



    printf("Enter priority:\n");
    scanf("%d", &std[I].priority);


    I still get a segmentation fault as soon as I enter a number
  8. Replies
    23
    Views
    3,447

    I noticed that, in my code they're both "I" but...

    I noticed that, in my code they're both "I" but when I post it hear they convert to "i"s for some reason. I get to the point where I add a new message, tell it how many messages I want to add, then...
  9. Replies
    23
    Views
    3,447

    Im here to learn so if you have better...

    Im here to learn so if you have better alternatives id love to hear them :)
  10. Replies
    23
    Views
    3,447

    Thanks for the help guys, I have this code now...

    Thanks for the help guys, I have this code now which freezes after I input the values:


    #include <stdio.h>
    #include <string.h>


    int main ()
    {
    struct MSG {
  11. Replies
    23
    Views
    3,447

    segfaulting!

    Im getting a segmentation fault when I try to run the program and add new message. As soon as I input the 3 values it segfaults. Any help?



    #include <stdio.h>
    #include <string.h>

    struct...
  12. Kind of getting there. This code outputs the...

    Kind of getting there. This code outputs the first word but it gets stuck in a looping cycle




    #include <stdio.h>
    #include <string.h>
    #define MAXLENGTH 256
    #define delimiter ""
  13. I got it! Sort of. So the code below does this...

    I got it! Sort of. So the code below does this now:
    Hello world
    Hello
    world

    Which is exactly what I want the program to do but not the way it currently does it.


    #include <stdio.h>...
  14. Im going to try to finish the current program...

    Im going to try to finish the current program since it seems like im having trouble even using the strtok function. I fixed the compiling errors that i was receiving, but im still segfaulting when I...
  15. This might be a stupid question, but I was...

    This might be a stupid question, but I was thinking, would it be possible to use strtok within that function? I know how to make this program using strtok, so it would be awesome if i could just...
  16. It does not have to work like strtok, thats the...

    It does not have to work like strtok, thats the only thing i could find to get me started. The only requirement is it have this function:

    char *next_word(char *instring, char **new_start)

    Do...
  17. so char* parsed=instring;? Ill definitely be...

    so char* parsed=instring;?
    Ill definitely be uncommenting the print statements once this program makes it to that point lol
  18. Okay I think I got it, but it gives me the...

    Okay I think I got it, but it gives me the assignment makes integer from pointer w/o cast error. Also, I believe Im getting a segmentation fault after I type in my sentence.



    #include <stdio.h>...
  19. yeah honestly I had no idea what I was doing with...

    yeah honestly I had no idea what I was doing with calling the function. Now I feel like my strtok code isnt going to work properly :( Is there a way I can test it without calling it into the main...
  20. having some trouble calling a function in the main program

    Hi everyone. I'm writing this program that takes a sentence and breaks it up into words and spits that out in a vertical column. I couldn't use the "strtok" function so I wrote one from scratch....
Results 1 to 20 of 20