Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Commit

Permalink
attempts at pointer logic, from memory (human).
Browse files Browse the repository at this point in the history
  • Loading branch information
jzacsh committed Feb 22, 2011
1 parent 0b29b0c commit c7642c8
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions ptr/list.c
@@ -1,11 +1,25 @@
#include<stdio.h>

struct {
char *name[],
int **next,
} li;
typedef struct li_t {
int value;
struct li_t *next;
} item;

int main(int argc, char *argv[], char *envp[])
{
// li itemone;
item * head, *current;
int i, list_size = 10;

head = NULL;

printf("Will create a %d item list.\n", list_size);
item contacts = * malloc(sizeof(item));

for (i = 0; i < list_size; i++) {
printf(".. creating number #%2.d in the list.\n", i+1);
nums->next = head;
nums->value = i;
}

return(0);
}

0 comments on commit c7642c8

Please sign in to comment.