Search:

Type: Posts; User: difficult.name

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    40,265

    Thanks, got it working and I understand now!

    Thanks, got it working and I understand now!
  2. Replies
    4
    Views
    40,265

    printing char* strings

    I'm trying to print a string stored in a char* variable. The contents are coming out correctly except that there's funny ASCII symbols printed at the end......

    Variable: char* temp;
    Reading:...
  3. Sorry, I didn't explain very well. typedef...

    Sorry, I didn't explain very well.


    typedef struct{
    int bob, back, front;
    }NODE; // this is what I meant

    typedef struct{
    NODE *list;
    //....
  4. Returning error code in linked list, typecast?

    I have a strcture called NODE to hold my list and a function NODE find() that looks for an item in the list and returns the NODE. How would I return an error code if the item isn't found? If I just...
  5. Replies
    2
    Views
    1,183

    Comparing structures?

    Can I compare the data contents of two structures? For example, if I have

    typedef struct{
    int a;
    char b;
    } HELP;

    // ........ main:
    HELP stuff1, stuff2;
  6. Doesn't calling the function to to create a new...

    Doesn't calling the function to to create a new variable make it separate from one that was created in a previous call? What I'm doing is basically this:


    main()
    {
    // .........

    Queue...
  7. Problem when concatenating two dynamic queues

    I have a Queue *q1, *q2 in main() that I send off the a function to initialize that looks like this:


    Queue *CreateQueue () {
    Queue *queue;

    queue->front = queue->rear = NULL;

    ...
  8. Replies
    4
    Views
    2,467

    Queue without a counter?

    I can make static circular queues using a counter in the queue structure to keep track of the number of items in the queue, but I'm having trouble doing it without a counter. Using a count function,...
  9. Replies
    2
    Views
    7,697

    Concatenating two static queues?

    How would I go about concatenating two static queues together? I'm guessing I take the second queue and append it onto the first, but since they are static queues I can't change the size.... below...
  10. Replies
    1
    Views
    2,527

    Trouble storing file input in array

    I'm using the following to read a 3 line by 3 column file and storing it into the array. However, when I try to print out the array contents, only the first line is correct. The rest is either...
  11. Replies
    2
    Views
    1,142

    Basic linked list help

    typedef struct node{
    int data;
    struct node *next;
    }Node, *NodePtr;

    typedef struct{
    NodePtr stack;
    }Stack, *StackPtr;

    Stack st;
  12. Replies
    3
    Views
    2,932

    This is what I have so far for my stack...

    This is what I have so far for my stack implementation:



    #define MAX 10
    typedef struct {
    int stack[MAX];
    int sp;
    } stack, *stackPtr;
  13. Replies
    3
    Views
    2,932

    Help understanding typedef structs

    I understand basic structures with typedef like the following:


    typedef struct {
    int month, day, year;
    } date;
    date var1, var2;


    But I just can't figure out what something like this for...
  14. Replies
    4
    Views
    6,376

    Restrict scanf() input?

    While reading a %d integer value into scanf, is there a way to restrict or check input so that invalid input like characters won't mess up the program?
  15. That fixed it, thanks!

    That fixed it, thanks!
  16. How to pass a typedef struct to function?

    Hi, I'm trying to understand how to pass typedef structures to a function. The following is how I'm trying to do it, but it doesn't work (parse errors). What am I doing wrong?



    #include...
Results 1 to 16 of 16