User Profile

Collapse

Profile Sidebar

Collapse
viperdriver87
viperdriver87
Last Activity: Jul 19 '07, 09:11 PM
Joined: Jun 26 '07
Location: Detroit, Michigan
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • viperdriver87
    replied to Dynamic Array of Structs Problem
    in C
    Excellent, this worked! Thanks to ravenspoint, RedSon, and mac111!
    See more | Go to post

    Leave a comment:


  • viperdriver87
    started a topic Dynamic Array of Structs Problem
    in C

    Dynamic Array of Structs Problem

    Greetings all, I had another post on here about a Dynamic array of ints problem, and with your help, I managed to solve that problem. Now, I've another issue. I need to dyanically allocate an array of structs.

    The struct is defined as:

    Code:
    struct song{
    
      char name[50];
      char title[50];
    
    };
    So, for work, they want me to sort through the songs, but due to memory constraints...
    See more | Go to post

  • viperdriver87
    replied to Dynamic array of ints problem
    in C
    Brilliant! Problem solved, thanks a bunch!
    See more | Go to post

    Leave a comment:


  • viperdriver87
    replied to Dynamic array of ints problem
    in C
    Ok, that's not a problem. But, say I do malloc it like this:

    struct queue {


    int front;
    int elements;
    int asize;
    int * qlist;

    };

    ...

    struct queue * resize(int size){
    struct queue * q;

    q->front = 0;
    q->elements = 0;
    q->asize = size;
    q->qlist = (int *)malloc(sizeof (int) * size);
    ...
    See more | Go to post

    Leave a comment:


  • viperdriver87
    started a topic Dynamic array of ints problem
    in C

    Dynamic array of ints problem

    Greetings all, I'm working on a program that contains a struct:

    struct queue {

    int front; //the front of the queue
    int elements; //the number of elements in the queue
    int asize; //the size of the array
    int qlist[]; //an array that will be dynamically sized

    };

    My objective is to read from a file, the length of the queue. Now, I've tried...
    See more | Go to post
No activity results to display
Show More
Working...