Help me! indentation problem
I m using DEVcpp. I have auto indentation generated like this.
i want to fix my tab and to 4 spaces.... plz help...
Code:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
//-----------------------------------------------
//-- inputarray defi --
void inputarray(int size, double* array){
int a=0;
for(; a<size; a++){
printf("Enter Value %d: ",a+1);
scanf("%lf",(array+a));
}
}
// ** inputarray end **
//----------------------------------------------
//-- printarray defi --
void printarray(int size, double* array){
int a=0;
for(; a<size; a++){
printf("%lf\n",*(array+a));
}
}
// ** printarray end **
//------------------------------------------------
// ** inputarray end **
//-- sortarray defi --
void sortarray(int size, double* array, char order)
{
int a=0,b=0,chck=0;
double temp=0;
// -------Swith Case Start-------
switch(order){
case 'A':
case 'a':
for(b=0; b<size; b++){
chck=0;
for(a=0; a<size-1;a++){
if(*(array+a)>*(array+a+1)){
chck++;
temp=*(array+a);
*(array+a)=*(array+a+1);
*(array+a+1)=temp;
}
}
if(chck == 0)
break;
}
break;
case 'D':
case 'd':
for(b=0; b<size; b++){
chck=0;
for(a=0; a<size-1;a++){
if(*(array+a)<*(array+a+1))
{
chck++;
temp=*(array+a);
*(array+a)=*(array+a+1);
*(array+a+1)=temp;
}
}
if(chck == 0)
break;
}
}
//--------------Switch case end--------------
}
// ** sortarray end **
//-----------------------------------------------
// ** mergeandsortarray definition **
void mergeandsortarray(int size1, double* arr1, int size2, double* arr2, double* arr3){
int a=0,b=0,c=0;
//int size3=size1+size2,i=0,z=0,q=0;
sortarray(size1,arr1,'D');
sortarray(size2,arr2,'D');
while(a != size1 || b != size2){
if( *(arr1+a) > *(arr2+b)){
*(arr3+c)=*(arr1+a);
a++;
}
else{
*(arr3+c)=*(arr2+b);
b++;
}
c++;
}
}
// --mergeandsortarray end--
//-----------------------------------------------
//-- int main --
int main()
{
double *arr1, *arr2, *arr3;
int size1,size2,size3;
char order;
//Array 1 Functions
printf("\nEnter the size of array 1: ");
scanf("%d",&size1);
arr1=(double *)malloc(size1*sizeof(double));
inputarray(size1,arr1);
sortarray(size1,arr1,'D');
//Array 2 Functions
printf("\nEnter the size of array 2: ");
scanf("%d",&size2);
arr2=(double *)malloc(size2*sizeof(double));
inputarray(size2,arr2);
sortarray(size2,arr2,'D');
//Array 3 Functions
size3=size1+size2;
arr3=(double *)malloc(size3*sizeof(double));
mergeandsortarray(size1, arr1, size2, arr2, arr3);
printf("\nSorted Array 3, consisted of %d elements\n",size3);
printarray(size3,arr3);
getch();
return 0;
}
//** main end **
//-----------------------------------------------------