Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how can we Declare a variable in c without defining it.



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

Post New Answer

More C Interview Questions

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

0 Answers  


How can I determine whether a machines byte order is big-endian or little-endian?

0 Answers  


what is the definition of storage classes?

3 Answers   Wipro,


how to make program without <> in libray.

0 Answers  


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!

1 Answers   Lucent,


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

0 Answers  


What is the use of the sizeof operator?

2 Answers  


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.

0 Answers   Oracle,


how to find sum of digits in C?

21 Answers   CTS, Infosys,


Program to find the sum of digits of a given number until the sum becomes a single digit

8 Answers   InterGraph,


Categories