Thanks, got it working and I understand now!
Type: Posts; User: difficult.name
Thanks, got it working and I understand now!
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:...
Sorry, I didn't explain very well.
typedef struct{
int bob, back, front;
}NODE; // this is what I meant
typedef struct{
NODE *list;
//....
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...
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;
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...
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;
...
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,...
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...
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...
typedef struct node{
int data;
struct node *next;
}Node, *NodePtr;
typedef struct{
NodePtr stack;
}Stack, *StackPtr;
Stack st;
This is what I have so far for my stack implementation:
#define MAX 10
typedef struct {
int stack[MAX];
int sp;
} stack, *stackPtr;
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...
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?
That fixed it, thanks!
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...