C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - General Questions (Q.No. 2)
2.
What are the types of linkages?
Answer: Option
Explanation:
External Linkage-> means global, non-static variables and functions.
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.
Discussion:
95 comments Page 1 of 10.
Ujwala said:
2 decades ago
Details of internal & none linkage ?
Suresh said:
2 decades ago
What is static variable?
Ago balan said:
1 decade ago
int a; --> Here a is a variable of integer. We can increment the value of a using for loop.
static int a; --> Whenever 'a' is called at any line in a program 'a' value is assigned automatically that value is previous value of a we used sometime earlier in program. Actually static is storage class.
static int a; --> Whenever 'a' is called at any line in a program 'a' value is assigned automatically that value is previous value of a we used sometime earlier in program. Actually static is storage class.
Shan said:
1 decade ago
I wanna a briefly explain about the linkages.
Kailash said:
1 decade ago
'static' is fixed with respect to time. But dynamic can change with respect to time.
Komal said:
1 decade ago
I wanna a briefly explain about the linkages.
Kaamani said:
1 decade ago
I want example program for three linkages.
Vidvesh said:
1 decade ago
Tell me more about static variables???
Sathish narasimman said:
1 decade ago
static example..
int main()
{
printf(" %d",root());
printf(" %d",root());
}
int root()
{
static int i;
i++;
return i;
}
it will print the updated value every time example: o/p=1 2 3 4...
where as if we use int i in the place of static int i, in the root function.. always print 1 1 1 1
int main()
{
printf(" %d",root());
printf(" %d",root());
}
int root()
{
static int i;
i++;
return i;
}
it will print the updated value every time example: o/p=1 2 3 4...
where as if we use int i in the place of static int i, in the root function.. always print 1 1 1 1
Swathy said:
1 decade ago
@shan and @komal
external - throughout the program
internal - a single file
none - local to a single function
external - throughout the program
internal - a single file
none - local to a single function
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers