Category: Pointer
code: #include<stdio.h> typedef union { double weight; int size; char color[10]; } Description; typedef struct { int…
code: #include<stdio.h> typedef struct { int roll; char name[20]; double gp; double phy,chem,math; }sTudent; void inputStudent(sTudent *sp)…
code: #include<stdio.h> typedef struct { int roll; char name[20]; double gp; } sTudent; void inputStudent(sTudent *sp) {…
code: //dynamically 2d array #include<stdio.h> #include<stdlib.h> int **allocate(int nRows,int nCols) { int **p; p=(int**)malloc(nRows*sizeof(int*)); if(p==NULL) exit(0); int…
malloc() code: #include<stdio.h> #include<stdlib.h> int main() { int *p; int n; printf(“how many integers:”); scanf(“%d”,&n); p=(int*)malloc(n*sizeof(int)); if(p==NULL)…
code: #include<stdio.h> int main() { void *vp; int x=100; vp=&x; //printf(“%d\n”,*vp); //it will give error because it’s…
Recent Comments