I'm having problems with my code all over. I have to be able to open a command line argument( which i know how to do). create a linked list, and print it backwards. This is what i have but im stuck with errors that i don't know how to fix. I don't have any errors in the insertNode function just main and printList. basically if the file i open is "ABC" , I need to print "CBA"
header file:
#include <stdio.h>
#define my
typedef char KEY_TYPE;
typedef struct
{
KEY_TYPE key;
} DATA;
typedef struct nodeTag
{ DATA data;
struct nodeTag* link;
} NODE;
Main:
#include "my.h"
#include <stdio.h>
int main(int argc, char *argv[])
{
NODE* pList;
FILE* p;
pList = NULL; NODE* pPre = NULL; DATA item; int y;
p = fopen(argv[1],"r");
while(y = fscanf(p, %c, &(item.key))!EOF);
{
pList = insertNode(pList,pPre,item);
}
countVowels (NODE* pList);
countChars (NODE* pList);
return 0;
}
PRINTLIST FUNCTION:
#include "my.h"
#include <stdio.h>
void printList (NODE* pList)
{
NODE* pWalker;
pWalker = pList;
printf("The linked list is ");
while(pWalker)
{
printf("%3c", pWalker.data.key);
pWalker = pWalker->link;
}
printf("\n");
return;
}
these are basically errors i keep getting:
main.c:11: error: syntax error before '%' token
main.c:13: warning: assignment makes pointer from integer without a cast
printlist.c: In function `printList':
printlist.c:11: error: request for member `data' in something not a structure or union