Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged pointers
1
votes
3
answers
91
NIELIT 2017 OCT Scientific Assistant A (IT) - Section B: 29
Consider the following declaration. int a, *b = &a, **c = &b; a = 4; **c = 5; If the statement b = (int *)**c Is appended to the above program fragment then Value of $b$ becomes $5$ Value of $b$ will be the address of $c$ Value of $b$ is unaffected None of these
Consider the following declaration.int a, *b = &a, c = &b; a = 4; c = 5;If the statementb = (int *) cIs appended to the above program fragment thenValue of $b$ becomes ...
admin
936
views
admin
asked
Apr 1, 2020
Programming in C
nielit2017oct-assistanta-it
programming
pointers
+
–
2
votes
2
answers
92
NIELIT 2017 DEC Scientific Assistant A - Section B: 42
Which of the following is illegal declaration in $C$ language? char*str ="Raj is a Research scholar"; char str[25] ="Raj is a Research scholar"; char str[40] ="Raj is a Research scholar"; char[]str ="Raj is a Research scholar";
Which of the following is illegal declaration in $C$ language?char*str ="Raj is a Research scholar";char str[25] ="Raj is a Research scholar";char str[40] ="Raj is a Rese...
admin
1.8k
views
admin
asked
Mar 31, 2020
Programming in C
nielit2017dec-assistanta
programming-in-c
pointers
array-of-pointers
+
–
4
votes
1
answer
93
NIELIT 2016 MAR Scientist B - Section C: 14
Prior to using a pointer variable it should be declared. initialized. both declared and initialized. none of these.
Prior to using a pointer variable it should bedeclared.initialized.both declared and initialized.none of these.
admin
2.1k
views
admin
asked
Mar 31, 2020
Programming in C
nielit2016mar-scientistb
programming-in-c
pointers
+
–
4
votes
4
answers
94
NIELIT 2016 DEC Scientist B (IT) - Section B: 11
What is the meaning of following declaration? int(*p[7])(); $p$ is pointer to function $p$ is pointer to such function which return type is array $p$ is array of pointer to function $p$ is pointer to array of function
What is the meaning of following declaration?int(*p[7])();$p$ is pointer to function$p$ is pointer to such function which return type is array$p$ is array of pointer to f...
admin
1.5k
views
admin
asked
Mar 31, 2020
Programming in C
nielit2016dec-scientistb-it
programming-in-c
pointers
array-of-pointers
+
–
2
votes
1
answer
95
NIELIT 2017 July Scientist B (IT) - Section B: 34
Output of following program? #include<stdio.h> int main() { int *ptr; int x; ptr=&x; *ptr=0; printf("x=%d\n",x); printf("*ptr=%d\n",*ptr); *ptr+=5; printf("x=%d\n",x); printf("*ptr=%d\n",*ptr); (*ptr)++; ... $x=$garbage value $^*ptr=$garbage value $x=0$ $^*ptr=0$ $x=0$ $^*ptr=0$ $x=0$ $^*ptr=0$
Output of following program? #include<stdio.h int main() { int *ptr; int x; ptr=&x; *ptr=0; printf("x=%d\n",x); printf("*ptr=%d\n",*ptr); *ptr+=5; printf("x=%d\n",x); pri...
admin
677
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-it
programming-in-c
pointers
+
–
2
votes
1
answer
96
NIELIT 2017 July Scientist B (IT) - Section B: 35
Assume that float takes $4$ bytes, predict the output of following program. #include<stdio.h> int main() { float arr[5]={12.5,10.0,13.5,90.5,0.5}; float *ptr1=&arr[0]; float *ptr2=ptr1+3; printf("%f",*ptr2); printf("%d",ptr2-ptr1); return 0; } $90.500000\:\:3$ $90.500000\:\:12$ $10.000000\:\:12$ $0.500000\:\:3$
Assume that float takes $4$ bytes, predict the output of following program.#include<stdio.h int main() { float arr[5]={12.5,10.0,13.5,90.5,0.5}; float *ptr1=&arr[0]; floa...
admin
2.7k
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-it
programming-in-c
pointers
array-of-pointers
+
–
10
votes
1
answer
97
ISRO2020-63
What is the output in a $32$ bit machine with $32$ bit compiler? #include<stdio.h> rer(int **ptr2, int **ptr1) { int *ii; ii=*ptr2; *ptr2=*ptr1; *ptr1=ii; **ptr1*=**ptr2; **ptr2+=**ptr1; } void main(){ int var1=5, var2=10; int *ptr1=&var1,*ptr2=&var2; rer(&ptr1,&ptr2); printf("%d %d",var2,var1); } $60,70$ $50,50$ $50,60$ $60,50$
What is the output in a $32$ bit machine with $32$ bit compiler?#include<stdio.h rer(int ptr2, int ptr1) { int *ii; ii=*ptr2; *ptr2=*ptr1; *ptr1=ii; ptr1*= ptr2; ptr2...
srestha
4.0k
views
srestha
asked
Jan 12, 2020
Programming in C
isro-2020
programming
programming-in-c
normal
pointers
+
–
12
votes
2
answers
98
ISRO2020-62
What is output of the following ‘C’ code assuming it runs on a byte addressed little endian machine? #include<stdio.h> int main() { int x; char *ptr; x=622,100,101; printf("%d",(*(char *)&x)*(x%3)); return 0; } $622$ $311$ $22$ $110$
What is output of the following ‘C’ code assuming it runs on a byte addressed little endian machine?#include<stdio.h int main() { int x; char *ptr; x=622,100,101; pri...
srestha
5.8k
views
srestha
asked
Jan 12, 2020
Programming in C
isro-2020
programming
programming-in-c
normal
pointers
+
–
1
votes
2
answers
99
How Self-Referential Structure works?
I have learnt that self-referential structure is one which contains a structure of same type in it as an element. But I have a doubt regarding how that line is compiled successfully (i.e, how compiler knows how much space should be allocated and ... not yet finished? struct node { int data; struct node *next; }; correct me If I am wrong in understanding this.
I have learnt that self-referential structure is one which contains a structure of same type in it as an element. But I have a doubt regarding how that line is compiled s...
Sathuri Bharath
1.2k
views
Sathuri Bharath
asked
Jun 12, 2019
Programming in C
programming-in-c
pointers
+
–
4
votes
4
answers
100
Pointers address
https://gateoverflow.in/?qa=blob&qa_blobid=14433986388826671915 int main() { int a = 10; int *b = &a; scanf("%d",b); printf("%d",a+50); } What will be the Output of the following code if input given is $25$ ?
https://gateoverflow.in/?qa=blob&qa_blobid=14433986388826671915int main() { int a = 10; int *b = &a; scanf("%d",b); printf("%d",a+50); }What will be the Output of the fol...
Manoj Kumar Pandey
830
views
Manoj Kumar Pandey
asked
May 22, 2019
Programming in C
programming-in-c
pointers
+
–
1
votes
1
answer
101
Can anyone please explain this question step by step
#include<stdio.h> int main(){ int (*a)[5]; int arr[5][5]={ {10,65,300,400,500}, {100,20,3000,40,5000} }; a = arr; ++a ; char *ptr = (char*)*a; ++a ; printf("%d %d %d",**a,*arr[1],*ptr); return 0; }
#include<stdio.h int main(){ int (*a)[5]; int arr[5][5]={ {10,65,300,400,500}, {100,20,3000,40,5000} }; a = arr; ++a ; char *ptr = (char*)*a...
kaveeshnyk
1.1k
views
kaveeshnyk
asked
May 7, 2019
Programming in C
programming-in-c
pointers
array-of-pointers
programming
+
–
1
votes
1
answer
102
Array of Pointers-Self Doubt
$1)$ How to access array element with array of pointers? By pointer to an array we can access like this $(*a)[0]$,$(*a)[22]$, .. like this right? but how with array of pointer? $2)$Check these three codes , one of them use array and one of them use ... main(void) { if(*(ptr+5)==*(ptr+3)){ printf("Equal"); } else{ printf("Not Equal"); } return 0; }
$1)$ How to access array element with array of pointers? By pointer to an array we can access like this $(*a)[0]$,$(*a)[22]$,….. like thisright?but how with array of po...
srestha
836
views
srestha
asked
May 5, 2019
Programming in C
pointers
programming-in-c
+
–
0
votes
1
answer
103
#pointer #output #error-assignment-makes-pointer-from-integer-without-a-cast #self-doubt
#include <stdio.h> #include<stdlib.h> int main() { //code char *ptr,s[]="debasree"; ptr=s[0]; printf("%s\n",*ptr); return 0; } I get this warning in geeks for geeks ... explain what is the warning saying? i googled a lot but could not grasp it pls pls pls pls explain...
#include <stdio.h #include<stdlib.h int main() { //code char *ptr,s[]="debasree"; ptr=s[0]; printf("%s\n",*ptr); return 0; } I get this warning in geeks for...
debasree88
2.5k
views
debasree88
asked
Apr 24, 2019
Programming in C
pointers
output
+
–
0
votes
0
answers
104
Ullman(2e) Exercise-8.3.2 page no-524 Code Generation
Generate code for the following three-address statements assuming stack allocation where register SP points to the top of the stack x = 1 x=a x = a + 1 x = a+b The two statements x = b * c y = a + x
Generate code for the following three-address statements assuming stack allocation where register SP points to the top of the stackx = 1x=ax = a + 1x = a+bThe two stateme...
aditi19
988
views
aditi19
asked
Apr 1, 2019
Compiler Design
compiler-design
intermediate-code
target-code-generation
stack
pointers
+
–
1
votes
2
answers
105
Pointer question-C
Anyone kindly tell the reason why the outputs are differ ? #include<stdio.h> int main() { char *ptr = "geeksforgeeks"; printf("%c\n", *&*&*ptr); getchar(); return 0; } Output-g #include<stdio.h> int main() { char *ptr = "geeksforgeeks"; printf("%s\n", *&*&ptr); getchar(); return 0; } Output-geeksforgeeks
Anyone kindly tell the reason why the outputs are differ ?#include<stdio.h>int main(){ char *ptr = "geeksforgeeks"; printf("%c\n", *&*&*ptr); getchar(); return 0;}Outp...
val_pro20
1.5k
views
val_pro20
asked
Mar 24, 2019
Programming in C
programming-in-c
pointers
+
–
1
votes
0
answers
106
Geeks for Geeks : C Program
In the above 4 Statements which would print 123 as output ? Explain also.
In the above 4 Statements which would print 123 as output ? Explain also.
Ashish Roy 1
1.7k
views
Ashish Roy 1
asked
Mar 16, 2019
Programming in C
programming-in-c
output
pointers
programming
+
–
2
votes
1
answer
107
Programming in C: What is the output of program? Explain for all the statements
int main() { int m=44; int *p=&m; int &r=m; int n=(*p)++; int *q=p-1; r=--*(p)+1; ++*q; printf("m=%d n=%d r=%d",m,n,r); return 0; } Options: $m=44,\ n=46,\ r=45$ $m=45,\ n=44,\ r=45$ $m=46,\ n=44,\ r=46$ $m=46,\ n=43,\ r=46$
int main() { int m=44; int *p=&m; int &r=m; int n=(*p)++; int *q=p-1; r= *(p)+1; ++*q; printf("m=%d n=%d r=%d",m,n,r); return 0; } Options:$m=44,\ n=46,\ r=45$$m=45,\ n=4...
Nishi Agarwal
1.6k
views
Nishi Agarwal
asked
Mar 10, 2019
Programming in C
programming-in-c
pointers
+
–
1
votes
2
answers
108
Array
Tell me the difference : &(arr+1) and &arr+1
Tell me the difference :&(arr+1) and &arr+1
Ahsanul Hoque
1.3k
views
Ahsanul Hoque
asked
Feb 17, 2019
Programming in C
programming-in-c
pointers
array
+
–
0
votes
1
answer
109
is it dangling pointer
is it dangling pointer ? int main(void) { int* p; printf("%d",*p); return 0; } https://ideone.com/IN77el
is it dangling pointer ?int main(void) { int* p;printf("%d",*p); return 0;} https://ideone.com/IN77el
Gurdeep Saini
653
views
Gurdeep Saini
asked
Feb 1, 2019
Programming in C
pointers
programming-in-c
+
–
1
votes
1
answer
110
Applied Course | Mock GATE | Test 1 | Question: 17
What is the output of the following c program void fun1(int *a, int *b, int *c) { *a = *b; *b = *c; *c = *a; } Void fun2(int a, int b, int c) { a = b; b = c; c = a; } int main() { int a = 5, b =10, c =15; fun1(&a, &b, &c); fun2(a, b, c); printf("%d", a+b-2*c); return 0; } $20$ $40$ $5$ $-5$
What is the output of the following c programvoid fun1(int *a, int *b, int *c) { *a = *b; *b = *c; *c = *a; } Void fun2(int a, int b, int c) { a = b; b = c; c = a; } int ...
Applied Course
605
views
Applied Course
asked
Jan 16, 2019
Programming in C
applied-course-2019-mock1
programming
programming-in-c
pointers
+
–
0
votes
1
answer
111
C Programming
main() { unsigned int i= 255; char *p= &i; int j= *p; printf("%d\n", j); unsigned int k= *p; printf("%d", k); } Both the outputs are -1. I have even tried with - int i = 255(3rd line). Still the output is -1. I don't understand how it is -1.
main(){unsigned int i= 255;char *p= &i;int j= *p;printf("%d\n", j);unsigned int k= *p;printf("%d", k);} Both the outputs are -1. I have even tried with - int i = 255(3rd ...
Psnjit
1.2k
views
Psnjit
asked
Jan 12, 2019
Programming in C
programming-in-c
output
programming
pointers
+
–
1
votes
1
answer
112
Output of following program(Self Doubt)
#include <stdio.h> main (){ unsigned x = -10; int X = 20; if (X > x) printf ("Hello"); else{ printf ("%d",x); printf ("Jello"); } }
#include <stdio.h>main (){unsigned x = -10;int X = 20;if (X x) printf ("Hello");else{ printf ("%d",x); printf ("Jello"); }}
Na462
1.4k
views
Na462
asked
Jan 8, 2019
Programming in C
programming-in-c
output
pointers
+
–
0
votes
0
answers
113
Function Pointer question
#include<stdio.h> int main ( ) { int demo ( ); // What is this and what does it do? demo ( ); (*demo) ( ); } int demo ( ) { printf("Morning"); }
#include<stdio.h>int main ( ){ int demo ( ); // What is this and what does it do? demo ( ); (*demo) ( );}int demo ( ){ printf("Morning");}
gmrishikumar
852
views
gmrishikumar
asked
Jan 2, 2019
Programming in C
programming-in-c
pointers
array-of-pointers
functions
function-pointers
+
–
2
votes
0
answers
114
GATE Overflow | Mock GATE | Test 1 | Question: 36
#include<stdio.h> #define create_node struct node {char x, y;}; #define call_main int main() { #define create_pointer struct node *p=&obj; #define create_object(a,b) struct node obj={b+a,a}; #define print_value printf("%c", *((char*)p+1 ... are correct Only $2$ and $3$ are correct $1$, $2$ and $4$ are correct Only $3$ is correct
#include<stdio.h>#define create_node struct node {char x, y;};#define call_main int main() {#define create_pointer struct node *p=&obj;#define create_object(a,b) struct n...
Ruturaj Mohanty
786
views
Ruturaj Mohanty
asked
Dec 27, 2018
Programming in C
go-mockgate-1
programming
pointers
programming-in-c
+
–
3
votes
2
answers
115
MadeEasy Subject Test 2019: Programming & DS - Programming In C
char *a = “MADEEASY”; char *b = “GATECSIT2019”; char *r = a; char *s = b; printf(“%d”, (int) strlen (b+3[r] – 1[s])); return 0; Whats the output? Answer given 8
char *a = “MADEEASY”;char *b = “GATECSIT2019”;char *r = a;char *s = b;printf(“%d”, (int) strlen (b+3[r] – 1[s]));return 0; Whats the output? Answer given 8
Shamim Ahmed
590
views
Shamim Ahmed
asked
Dec 11, 2018
Programming in C
made-easy-test-series
programming
programming-in-c
pointers
+
–
0
votes
0
answers
116
MadeEasy Test Series: Programming & DS - Programming In C
jatin khachane 1
507
views
jatin khachane 1
asked
Nov 23, 2018
Programming in C
made-easy-test-series
programming
pointers
+
–
0
votes
1
answer
117
C programming
#include<stdio.h> void fun(int *p,int *q) { p=q; *p=q; } int i=0,j=1; int main() { fun(&i,&j); printf("%d%d",i,j); } What will be the output of i and j in 16-bit C Compiler?
#include<stdio.h void fun(int *p,int *q) { p=q; *p=q; } int i=0,j=1; int main() { fun(&i,&j); printf("%d%d",i,j); }What will be the output of i and j in 16-bit C Compiler...
Mr khan 3
1.0k
views
Mr khan 3
asked
Nov 3, 2018
Programming in C
programming-in-c
output
programming
pointers
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register