#include<stdio.h> #include<stdarg.h> void display(char *s, ...); void show(char *t, ...); int main() { display("Hello", 4, 12, 13, 14, 44); return 0; } void display(char *s, ...) { show(s, ...); } void show(char *t, ...) { int a; va_list ptr; va_start(ptr, s); a = va_arg(ptr, int); printf("%f", a); }
#include<stdio.h> int main() { char huge *near *far *ptr1; char near *far *huge *ptr2; char far *huge *near *ptr3; printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3)); return 0; }
#include<stdio.h> int main() { struct node { int data; struct node *link; }; struct node *p, *q; p = (struct node *) malloc(sizeof(struct node)); q = (struct node *) malloc(sizeof(struct node)); printf("%d, %d\n", sizeof(p), sizeof(q)); return 0; }
After sometime the stack memory will be filled completely. Hence stack overflow error will occur.
#include<stdio.h> int main() { int arr[] = {12, 13, 14, 15, 16}; printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0])); return 0; }
void *cmp();
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.