Programming Hint
#include <stdio.h>
typedef struct llist{
char data;
struct llist *next;
}llist;
main()
{
llist *c1,*c2,*c3,*c4,*c5;
c1=( llist *) malloc(sizeof( llist));
c2=( llist *) malloc(sizeof( llist));
c1->data='A';
c1->next= c2;
c2->data='B';
c3->data='C';
}
Makefile Hint
#please "man make" to learn more about the make command.
#try to type "make" or "make homework1a" to see the trick,
#after you create the Makefile in your working directory.
#assume you have file homework1[ab].cpp, necessary.cpp
CC=gcc
CFLAGS=-g -Wall
all:
make homework1a
make homework1b
homework1a: homework1a.cpp necessary.cpp
$(CC) $(CFLAGS) -o out1.exe homework1a.cpp necessary.cpp
homework1b: homework1b.cpp necessary.cpp
$(CC) $(CFLAGS) -o out2.exe homework1b.cpp necessary.cpp