A.C
func()
{
pritnf(" in fuction %d",MACRO);

}


MAIN.c

testfunc()
{
#define MACRO 10
printf("in test function %d", MACRO);
}
main()
{
printf("in main %d",MACRO);
func();
testfunc();
getch();

}

Answer Posted / modassir

The error is for the line where we try to call func()
where we try to print macro through printf, as because
macro is not define there.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a list in c?

800


How old is c programming language?

783


Are bit fields portable?

906


Why is it important to memset a variable, immediately after allocating memory to it ?

1779


Explain what is the difference between far and near ?

865


Differentiate between ordinary variable and pointer in c.

860


What is c mainly used for?

824


what are # pragma staments?

1818


What is the basic structure of c?

786


What is meant by type specifiers?

883


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1064


What is a protocol in c?

754


Explain what is the benefit of using an enum rather than a #define constant?

991


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

896


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

814