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

What are the different types of constants?

1075


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

2123


What does the error 'Null Pointer Assignment' mean and what causes this error?

1211


What are 'near' and 'far' pointers?

1031


How to write a multi-statement macro?

1037


What are the types of pointers?

1106


In a byte, what is the maximum decimal number that you can accommodate?

1132


What is scope and lifetime of a variable in c?

1045


Does c have circular shift operators?

1228


How to Throw some light on the splay trees?

1053


Implement bit Array in C.

1133


what do u mean by Direct access files? then can u explain about Direct Access Files?

2085


Explain how do you list a file’s date and time?

1035


Why ca not I do something like this?

1007


Is c programming hard?

1012