Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Why its returning an error?
- #include <stdio.h>
- int call()
- {
- extern int b;
- b=10;
- printf("%d",b);
- }
- int main ()
- {
- int b=8;
- call();
- return 0;
- }
- /tmp/ccAsFhWX.o:meka.c:(.text+0x7): undefined reference to `_b' collect2: ld returned 1 exit status
- #include <stdio.h>
- static int b;
- int call()
- {
- b=10;
- printf("%d",b);
- }
- int main ()
- {
- b=8;
- call();
- return 0;
- }
- #include <stdio.h>
- extern int b;
- void call()
- {
- b = 10;
- printf("%dn",b);
- }
- int b = 8;
- int main () {
- call();
- return 0;
- }
- #include <stdio.h>
- void call (int *b)
- {
- printf ("%dn", *b = 10);
- }
- int main () {
- int b = 8;
- call (&b);
- return 0;
- }
- void call (int *b) {
- *b = 10;
- printf("%d",*b);
- }
Add Comment
Please, Sign In to add comment