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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Should a function contain a return statement if it does not return a value?

1134


What is meant by inheritance?

1151


Write a program for Overriding.

1208


Do you have any idea how to compare array with pointer in c?

1090


What is an endless loop?

1317


What is the maximum no. of arguments that can be given in a command line in C.?

1199


What is the use of getchar() function?

1181


Find MAXIMUM of three distinct integers using a single C statement

1113


When should we use pointers in a c program?

1189


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2456


What are enumerated types?

1265


How can I get random integers in a certain range?

1124


Explain the advantages and disadvantages of macros.

1140


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1066


Explain what is the benefit of using #define to declare a constant?

1270