function dosent match on Code Vision

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HI Freaks
Long time..... :shock:

I added an H file to my file and here is the decleration of the H file:
#ifndef _SCAN_CODE_H_
#define _SCAN_CODE_H_

extern scan_code(void);

#endif /* _SCAN_CODE_H_ */

On the main routine i included it like that
#include "scan_code.h"

But i cannot compile it because i keep on getting an Error
"L7:function doent match previous decleration"

why???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As you will find if you consult any standard text on C programming, "scancode (void)" is >>not<< the same as the code of the function itself. Come to think of it, that is what the error message says.

IIRC, the prototype must match the function in name and return value type, and number, order, and type of parameters.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Lee
I am sure that this is a stupid thing that i am doing
But what did you mean by saying that the name of the routine doesnt match code of the function itself

Please advise
Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

check your declaration >>>

extern scan_code(void);

and the function itselfs.

May you post the function too ???

B-Tronic 8)