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

Advertisements 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. >Solution : The… Read More struct node * void expected identifier or '(' before 'void'

Why does a function in C(or Objective C) with no listed arguments allow inputting one argument?

Advertisements In C when a function is declared like void main(); trying to input an argument to it(as the first and the only argument) doesn’t cause a compilation error and in order to prevent it, function can be declared like void main(void);. By the way, I think this also applies to Objective C and not… Read More Why does a function in C(or Objective C) with no listed arguments allow inputting one argument?

Why do I get "forbids converting a string constant to ‘char*’" in C++?

Advertisements I’m trying to invert the case manually, and I tried this: char* invertirCase(char* str){ int size = 0; char* iterador = str; char* retorno = str; while (*iterador != ‘\0’) { if (retorno[size] < 96) { retorno[size] = *iterador + 32; } else { retorno[size] = *iterador – 32; } iterador++; size++; } return… Read More Why do I get "forbids converting a string constant to ‘char*’" in C++?