Tag Archives: pointers

Bubble sorting using recursion

#include<stdio.h> #include<stdlib.h> int * input(int *,int); int * sort(int *,int); void display(int*,int); int main() { int *a,n,i,j,c,temp; printf(“Enter number of numbers you want to sort?\n”); scanf(“%d”,&n); a = input(a,n); a = sort(a,n); display(a,n); } int * input(int *a,int n) { … Continue reading

Posted in Data Structures with C | Tagged , , , , | Leave a comment

E-14 Pointers

declared char *ptr; printed the address allocated to ptr (&ptr), garbage address of ptr (ptr ) and the garbage value (*ptr) Error: Segmentation Fault. Can you please explain why?

Posted in Data Structures with C | Tagged , , , | 5 Comments