how can we Declare a variable in c without defining it.
Answer / manoj
By using EXTRN.
Example:
File 1:
int GlobalVariable; // implicit definition
void SomeFunction(); // function prototype
(declaration)
int main() {
GlobalVariable = 1;
SomeFunction();
return 0;
}
File 2:
extern int GlobalVariable; // explicit declaration
void SomeFunction() { // function header (definition)
++GlobalVariable;
}
| Is This Answer Correct ? | 6 Yes | 1 No |
Write the following function in C. stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return - 1. The function should not make use of any C library function calls.
3 Answers Google, Infosys, JTL, OpenFeel,
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
How can I determine whether a machines byte order is big-endian or little-endian?
what is the definition of storage classes?
how to make program without <> in libray.
12344321 123 321 12 21 1 1 how i print this program??
5 Answers DSR Management, Winit,
Write a routine that prints out a 2-D array in spiral order!
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
What is the use of the sizeof operator?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
how to find sum of digits in C?
Program to find the sum of digits of a given number until the sum becomes a single digit