Search:

Type: Posts; User: Hikaru90

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    15
    Views
    4,708

    yeah I was going to make January = 1, but instead...

    yeah I was going to make January = 1, but instead I'm using strcmp. I still have it adding the day+31+28+leap... like that though.
  2. Replies
    15
    Views
    4,708

    yeah I don't think that's what I'm supposed to...

    yeah I don't think that's what I'm supposed to do, and I didn't realize that it mattered that I do the dayofyear now. I created a function for the day of year, so like if month = January, dayofyear...
  3. Replies
    15
    Views
    4,708

    ok so struct student *info; info =...

    ok so


    struct student *info;
    info = malloc(sizeof(struct student)*MAXLENGTH));

    for (i=0; i<MAXLENGTH-1; i++)
    {
    int *value[i];
    value[i] = malloc(sizeof(struct...
  4. Replies
    15
    Views
    4,708

    struct student *info; info = (struct...

    struct student *info;
    info = (struct student*)(malloc(sizeof(struct student)*MAXLENGTH));

    for (i=0; i<MAXLENGTH-1; i++)
    {
    int *value[i];
    value[i] = (struct...
  5. Replies
    15
    Views
    4,708

    struct student *info; info = (struct...

    struct student *info;
    info = (struct student*)(malloc(sizeof(struct student)*MAXLENGTH));

    for (i=0; i<MAXLENGTH-1; i++)
    {
    int *value[i];
    value[i] =...
  6. Replies
    15
    Views
    4,708

    yeah, the file shows the number of classes, then...

    yeah, the file shows the number of classes, then number of students, then the students firstname, lastname, month, day, year on same line, then next line is number of queried students, and then the...
  7. Replies
    15
    Views
    4,708

    Your saying the &info part of the Mergesort is...

    Your saying the &info part of the Mergesort is wrong right? I already have this

    struct student *info;
    info = (struct student*)(malloc(sizeof(struct student)*MAXLENGTH));

    Are you saying I...
  8. Replies
    15
    Views
    4,708

    Main with Merge Sort Function - Help Please

    Hi, could someone please help me with my main function that has merge sort in it?
    I'm not sure how to call it or how this should be set up. I read in a file that has students and they are...
  9. Replies
    9
    Views
    1,871

    yeah I guess I would have to do something...

    yeah I guess I would have to do something different for December because the problem says it's not sorted by year, only month and day for the birthdays. Maybe I can make another function or if...
  10. Replies
    9
    Views
    1,871

    we're supposed to use strcmp if the person has...

    we're supposed to use strcmp if the person has the same b-day as someone else.
  11. Replies
    9
    Views
    1,871

    month would be an array month[length], unless I...

    month would be an array month[length], unless I changed it to an int or I could maybe set January to equal 1, but I don't know where I would go from there, or I could add up the days and determine...
  12. Replies
    9
    Views
    1,871

    I'm just trying to get the idea of how I would do...

    I'm just trying to get the idea of how I would do this, and I said I was talking about after the sorting, which also means after reading in the input. The input was read in the way it is in the file...
  13. Replies
    9
    Views
    1,871

    There is an input file that says the birthdays of...

    There is an input file that says the birthdays of each person.
    The date in the input file would be written as JANUARY 31 1989, but the year doesn't matter because it's sorted by birthdays, not by...
  14. Replies
    9
    Views
    1,871

    Subtracting Days after Sorting

    After people are sorted in order of their birthdays, how can I subtract two birthdays to find out the days in between so I can know if the person to the left or the right of someone has the closest...
  15. Oh I have another struct now called customer and...

    Oh I have another struct now called customer and it has the name and time.
  16. I scanned in what was in the input file, which...

    I scanned in what was in the input file, which was # of days and # of customers. Then
    # of secs after 1pm they get in line, their name, and # of items bought on the same line in the file. Time...
  17. For the time, it also says the # of secs it takes...

    For the time, it also says the # of secs it takes to checkout of line once at front is
    40+60x(# of items being bought).
  18. I haven't done anything for the time since I'm...

    I haven't done anything for the time since I'm not sure how to do it yet, but I put
    char name[MAXNAMELEN+1]; in the main.
  19. yeah we could use queues with a linked list or...

    yeah we could use queues with a linked list or array, but I already started with a linked list, and I think that was the preferred way.

    Oh, and I forgot to include this:



    #define...
  20. Please Help with Printing and Lines for Queues using Linked Lists

    Hi, I need to have 3 lines and I need help with them please.

    This is example of the output:
    1:00:11pm: Customer ANGEL checking in line A.
    1:01:36pm: Customer ANGEL checking out of line 1 waited...
  21. Replies
    5
    Views
    1,339

    This creates a new and space for it right?...

    This creates a new and space for it right?
    struct queue *A = (struct queue*)malloc(sizeof(struct queue));

    By the way, these are my structs:


    // Stores node of the linked list.
    struct node {...
  22. Replies
    5
    Views
    1,339

    ok, but now it says invalid initializer. Are...

    ok, but now it says invalid initializer. Are they supposed to be pointers and am I supposed to allocate space?
  23. Replies
    5
    Views
    1,339

    Please Help with Queues

    How do I make several queues? Do I make just one struct and then do this in main:

    A = NewQueue();
    B = NewQueue();
    or is it:
    struct queue Q1;
    struct queue Q2;
  24. Replies
    2
    Views
    811

    Question about Struct

    When making a struct, why do some structs have struct* ? Does that mean there is a pointer to the struct? If so, then why would it be struct* block, instead of struct *block? Thanks in advance.
  25. Replies
    1
    Views
    1,458

    Scanning Arrays from a file

    fscanf(ifp, "%d", &num_couples);

    for(i=0; i<num_couples; i++)
    {
    for(j=0; j<num_couples; j++)
    {
    fscanf(ifp, "%s", man_name[j]);
    ...
Results 1 to 25 of 27
Page 1 of 2 1 2