search
Log In

Recent questions tagged pointers

1 vote
2 answers
1
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 its elements)when the ... structure is not yet finished? struct node { int data; struct node *next; }; correct me If I am wrong in understanding this.
asked Jun 12, 2019 in Programming Sathuri Bharath 298 views
3 votes
4 answers
2
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$ ?
asked May 22, 2019 in Programming Manoj Kumar Pandey 261 views
1 vote
1 answer
3
#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; }
asked May 7, 2019 in Programming kaveeshnyk 258 views
1 vote
1 answer
4
$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 array of pointer, and 3rd one ... **ptr[12]; int main(void) { if(*(ptr+5)==*(ptr+3)){ printf("Equal"); } else{ printf("Not Equal"); } return 0; }
asked May 5, 2019 in Programming srestha 211 views
0 votes
1 answer
5
#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 compiler Warnings: prog.c: In function 'main': prog.c:7:6: warning: assignment ... Segmentation Fault (SIGSEGV) can anyone pls explain what is the warning saying? i googled a lot but could not grasp it pls pls pls pls explain...
asked Apr 24, 2019 in Programming debasree88 315 views
0 votes
0 answers
6
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
asked Apr 1, 2019 in Compiler Design aditi19 282 views
0 votes
2 answers
7
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
asked Mar 24, 2019 in Programming val_pro20 258 views
1 vote
0 answers
8
In the above 4 Statements which would print 123 as output ? Explain also.
asked Mar 16, 2019 in Programming Ashish Roy 1 249 views
1 vote
2 answers
9
Tell me the difference : &(arr+1) and &arr+1
asked Feb 17, 2019 in Programming Ahsanul Hoque 382 views
0 votes
1 answer
10
is it dangling pointer ? int main(void) { int* p; printf("%d",*p); return 0; } https://ideone.com/IN77el
asked Feb 1, 2019 in Programming Gurdeep Saini 171 views
0 votes
1 answer
11
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.
asked Jan 12, 2019 in Programming Psnjit 243 views
1 vote
1 answer
12
#include <stdio.h> main (){ unsigned x = -10; int X = 20; if (X > x) printf ("Hello"); else{ printf ("%d",x); printf ("Jello"); } }
asked Jan 8, 2019 in Programming Na462 162 views
0 votes
0 answers
13
#include<stdio.h> int main ( ) { int demo ( ); // What is this and what does it do? demo ( ); (*demo) ( ); } int demo ( ) { printf("Morning"); }
asked Jan 2, 2019 in Programming gmrishikumar 179 views
...