-3

I was trying to build my project but I got this error I really don't understand the problem I've tried to define the variable this way:

char*c=malloc(100);

and even this way:

char c;

enter image description here

Thanx

Tommaso Bertoni
  • 2,333
  • 1
  • 22
  • 22

1 Answers1

2

Declaring variables in the middle of a function is a C99 feature. Your compiler may not support C99, or you may have to activate it with a switch. Move the declaration to the top of the function.

Ben Jackson
  • 90,079
  • 9
  • 98
  • 150