What's the best way to declare and define global variables?

Answer Posted / guest

The best arrangement is to place each definition in some
relevant .c file, with an external declaration in a header file.

Is This Answer Correct ?    17 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When can a far pointer be used?

589


application attempts to perform an operation?

1495


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15507


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

1803


what is a function method?give example?

1915






An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

673


Explain what are binary trees?

614


where are auto variables stored? What are the characteristics of an auto variable?

595


Explain union. What are its advantages?

619


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

608


Can we assign integer value to char in c?

617


Should I learn c before c++?

619


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

719


What is function prototype?

611


Why do we use & in c?

593