1

I am writing a c program and came across the declare() function.

When I searched on web for it, I received results about function declaration and function definition.

I would like to know about the declare() function in c,what it does, what are its parameters, etc.

Here is block of code that uses the function:

char file[50];
strcpy(file,"IS_inst.txt");
declare(file,IS_ins,&IS_inst_count);
strcpy(file,"DS_inst.txt");
declare(file,DS_ins,&DS_inst_count);
strcpy(file,"AD_inst.txt");
declare(file,AD_ins,&AD_inst_count);
strcpy(file,"REG_OPERAND.txt");
declare(file,REG_oprand,&REG_op_count);
gsamaras
  • 71,951
  • 46
  • 188
  • 305

4 Answers4

3

There is no such function in C, it might/should be defined in your program.

gsamaras
  • 71,951
  • 46
  • 188
  • 305
3

There is no function called declare in the C standard library, or, as far as I know, in any commonly used add-on library.

There's nothing special about the name declare. It might as well have been named foobar.

It must be declared as a function or as a macro somewhere in your program. If your development environment has such a feature, try querying the name (perhaps you can hover over or right-click on the function name if you're using an IDE). Or just search the source file and any headers it #includes for the name declare. grep and ctags are both useful tools for this kind of thing.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
0

You should implement this function in your code

Malek Ben el ouafi
  • 995
  • 12
  • 37
-1

Declare function means you are assigning a function's return type. There is no built in function named as "Declare Function". Suppose, you want to create a function to add numbers. So, you can name the function as "Add". In c programming you have to declare the function type at first example: for two integers addition the function type should be int Add() {}

Shadman Jahangir
  • 70
  • 1
  • 1
  • 7