hi , guys/
I again have problem with C understanding. Please help .
there's code =

/* */
#include <stdio.h> 
#include <stdlib.h>
#include <limits.h>
 main()
{ 
  char* inputstr; 


  inputstr = simple_readline(  "Please specify the input string (one more notification))" , 0);
  printf("\n You've specified string = %s\n", inputstr); 
 

 getchar();
 getchar();
 
}

char* simple_readline( const char* prompt, unsigned block_size )
  {
  char* result;   /* The malloc()ed string to return  */
  *result = "efef";
  return result;
  }

i can't understand whaere is the error here

please tell - where is the redeclaration here?

There's no prototype in scope for simple_readline() when you use it, and the arguments you provide, while compatible, don't exactly match the definition. The fix is to add a prototype for simple_readline() before main().

hm...does it mean then custom function can't work without the prototype ?

It means you should declare a function before using it.

oh...) earlier Turbo C allowed me to not do this))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.