1st problem
Program :
#include<stdio.h>
#include<conio.h>
void main(){
extern int a;
printf("%d",a);
}
int a=20;</conio.h></stdio.h>
when at first time i run this program , i gout output as 20
but after that whenever i tried to run this same program i got an error "Illegal variable at 0x1f"
and output should be 20 (according to solution manual of a book)
2nd problem
Program
#include<stdio.h>
#include<conio.h>
int main(){clrscr();
ichar str[] = "Part time musicians ar semiconductors";
int a = 5;
printf(a>10?"%50s":"%s",str);
getch();
}</conio.h></stdio.h>
here in this program i dont understand the significance of "%50s".
please explain me what "%50s" mean.
3rd Problem
Program :
main(){
char far *s1,*s2;
printf("%d%d",sizeof(s1),sizeof(s2));
}
this program gives output : 4 2
but i dont understan how it comes as no value is defined here.