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 8 of 10.
Anitha said:
1 decade ago
How can we print a string without using printf() and any other functions like puts() & get() ?
Sameer said:
1 decade ago
What is the meaning of functions of filescope?
Purnima said:
1 decade ago
Can you give me the brief explanation about linkages and what are the storage classes?
Sumanth said:
1 decade ago
Thanx Dixin
DixN said:
1 decade ago
The reason is
x=5
++x means x=6
then ++x means x=7
then only it will start to add
z=x+x
but at the end x=7
therefore
z=7+7
ie z=14 is the answer
x=5
++x means x=6
then ++x means x=7
then only it will start to add
z=x+x
but at the end x=7
therefore
z=7+7
ie z=14 is the answer
Gaurav said:
1 decade ago
x= 5;
z = ++x + ++x ;
cout<<z;
why does this display 14 , instead of 13 ?
z = ++x + ++x ;
cout<<z;
why does this display 14 , instead of 13 ?
Saikiran said:
1 decade ago
What Prathyusha said is correct. That can be easily understood using this program.
#include<stdio.h>
int main()
{
printf("\n%d",funi());
printf("\n%d",funi());
printf("\n%d",funi());
printf("\n%d",funj());
printf("\n%d",funj());
printf("\n%d",funj());
//printf("\ni=%d\nj=%d",i,j);
return 0;
}
int funi()
{
int i;
i++;
return i;
}
int funj()
{
static int j;
j++;
return j;
}
output:
1
1
1
1
2
3
#include<stdio.h>
int main()
{
printf("\n%d",funi());
printf("\n%d",funi());
printf("\n%d",funi());
printf("\n%d",funj());
printf("\n%d",funj());
printf("\n%d",funj());
//printf("\ni=%d\nj=%d",i,j);
return 0;
}
int funi()
{
int i;
i++;
return i;
}
int funj()
{
static int j;
j++;
return j;
}
output:
1
1
1
1
2
3
Siri said:
1 decade ago
Good explanation pratyusha, thanq so much.
Ram krishna said:
1 decade ago
I will thank full to Satish Narasimman and Prathyusa, who cleared my doubt.
Rajesh said:
1 decade ago
We declare already a static varible, in derived class we declare one more same static variable as declared first with different value, and call the previous variable,.......then.....Is the out put of program is first variable's value or secon variale's value...
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers