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);
5
  • Let me be the first to say... Huh? Commented Apr 14, 2016 at 17:45
  • 1
    Search the header files of the project for declare, it might be a macro (just guessing here). Commented Apr 14, 2016 at 17:46
  • If you use Visual Studio, press F12 on your declare function. If you use gcc, use the -E switch. If something else, try doing something along these lines. Commented Apr 14, 2016 at 17:49
  • How did you come across this function. You say you're writing a C program; did you write the code in the question? If not, where did it come from? Commented Apr 14, 2016 at 18:58
  • @Omkar Patil, you have plenty of answers to choose from, you should accept one!!! Commented Apr 18, 2016 at 7:48

4 Answers 4

3

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

0

You should implement this function in your code

Comments

-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() {}

1 Comment

This doesn't really answer the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.