I have a C program that produces an error:
invalid conversion from 'void*' to 'node*' [-fpermissive]
Here's my code:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct node
{
    int data;
    struct node* next;
};
struct node* onetwothree();
int main()
{
    struct node* ptr;
    ptr = onetwothree();
    return 0;
}
struct node* onetwothree()
{
    struct node* head;
    struct node* temp;
    head = malloc(sizeof(struct node));
    temp = head;
    for(int i=1; i<=3; i++)
    {
        temp->data = i;
        if(i<3)
            temp=temp->next;
        else
            temp->next = NULL;
    }
    return head;
}
What am I doing wrong?
 
     
     
     
    