662 views

1 Answer

Best answer
1 1 vote
defining "extern" is like giving a promise to the compiler that let me use it here as this variable is defined somewhere else and when you will use it you will get the memory reference.

So using extern is only declaring that this variable is available somewhere.

In this question we declared the variable $i$ but it was not intialized anywhere it does not have any memory allocated to it.

So in the next line when the program executes $i=1024$ then it will get no memory reference to $i$ and will throw undefined reference $'i'$
• selected by
Position:
Show:

Related questions

2 2 votes
1 1 answer
1.3k
1.3k views
Souvik33 asked Jan 11, 2023
1,270 views
The following C function rearranges the members of a single-linked list of integers that is passed as a parameter. The list of numbers 1, 2, 3, 4, 5, 6, and 7 in the spec...
1 1 vote
0 0 answers
1.7k
1.7k views
2 2 votes
0 0 answers
1.3k
1.3k views
srestha asked May 4, 2019
1,304 views
Consider the integer array $A\left [ 1.........100,1.......100 \right ]$ in which the elements are stored in $Z$ representation. An example of a $5\times 5$ array in $Z$ ...
2 2 votes
1 answers 1 answer
921
921 views
srestha asked Apr 24, 2019
921 views
Suppose a queue $Q$ and two stacks $S_{1}$ and $S_{2}$ as given below.void enqueue(Q,x){ push(S1,x); } void dequeue(Q,x){ if(stack-empty(S2))then if(stack-empty(S1))then{...