Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

struct node * void expected identifier or '(' before 'void'

There is a function like this. I took this error expected identifier or ‘(‘ before ‘void’
How to solve this problem? Thank you.

struct node * void ekleSirali(struct node * r,int x){
     if(r==NULL){
        r=(struct node *)malloc(sizeof(struct node));
        r->next=NULL;
        r->x =x;     
        return r;  
     }

I don’t know whether I should write struct.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The type specifier void is redundant and invalid in this context. Write

struct node * ekleSirali(struct node * r,int x){

That is the function return type can be either void (if the function returns nothing) or struct node * (if the function returns a pointer of the type struct node * as shown in your code snippet).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading