0

This doesn't work. Please help.

(line 8: invalid conversion from `const char' to `const char*' )

const char *alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int i=0;
do
{
            new_ptr = (struct node *)malloc(sizeof(struct node)); 
            new_ptr->next = NULL;   
            if (start == NULL) {    
                strcpy(new_ptr->letter, alphabet[i]);
                start = new_ptr;
                current = new_ptr;
            }
            else {      
                strcpy(new_ptr->letter, alphabet[i]);
                current->next = new_ptr;
                current = new_ptr;
            }
            //printf("***%s",*let);
            i++;
            //printf("***%s",*let);
        }while (alphabet[i] != '\0');

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by WaltP
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.