frndz i made my own string.h 18 functions but now problem is that i want to include my own header file like mjk.h
i have uploaded them here
http://ge.tt/4New76Z/v/0?c[
^]
or u can see the codes here but that would be difficult for me. please help
here are the codes :
#include<stdio.h>
#include<conio.h>
#include<string.h>
char* mjkchr(char [],char [],char);
void main()
{ char f[20];
char e[10],b;
puts("Enter your string:");
gets(e);
printf("\n Enter character:");
scanf("%c",&b);
mjkchr(f,e,b);
printf("\n Your mjkchr function output: %s",f);
getch();
}
char* mjkchr(char f[20],char a[10],char c)
{
int i,j=0,k=0;
for(i=0;a[i]!='\0';i++)
{
if(a[i]==c)
{
j=2;
}
if(j==2)
{
f[k]=a[i];
k++;
}
}
f[k]='\0';
return f;
}
#include<stdio.h>
#include<conio.h>
#include<string.h>
int mjkcmpi(char[],char [],int);
void main()
{
char a[20],b[20];
int m,ab;
printf("\n Enter string:");
gets(a);
puts("\n Enter string to compare:");
gets(b);
printf("\n Enter N#:");
scanf("%d",&ab);
m=mjkcmpi(a,b,ab);
printf("\n ASCII Difference= %d",m);
getch();
}
int mjkcmpi(char c[20],char d[20],int ab)
{
int i,j=0,k,l,x;
for(i=0;c[i]!='\0'&&d[i]!='\0'&&i<ab;i++)
{
if(c[i]+32==d[i]||c[i]-32==d[i]||c[i]==d[i]||d[i]+32==c[i]||d[i]-32==c[i])
//if(c[i]==d[i]||c[i]==d[i]+32||c[i]==d[i]-32 )
{
x=0;
}
else if(c[i]>d[i]&&c[i]!=d[i]&&c[i]>=97&&c[i]<=122||d[i]>=65&&d[i]<=90)
{
x=c[i]-(d[i]+32);
break;
}
else if(c[i]<d[i]&&c[i]!=d[i]&&c[i]>=65&&c[i]<=90&&d[i]>=97&&d[i]<=122)
{
x=c[i]-(d[i]-32);
break;
}
}
return x;
}
#include<stdio.h>
#include<conio.h>
#include<string.h>
char *mjkdup(char[],char[],char *);
void main()
{
char a[10],b[10],*c;
puts("Enter Your String:");
gets(a);
mjkdup(a,b,c);
printf("\n your Duplicated String: %s",mjkdup(a,b,c));
getch();
}
char *mjkdup(char e[10],char f[10],char *g)
{
/* Aur sir ic ka ek aur method bi ha jis me sirf ek array aur ek pointer ki zarorat hni ha
char mjkdup(char c[10],char *d)
{ d=c;
return d;
}
*/
strcpy(f,e);
g=f;
return g;
}
here is 3 or 4 programs can u guyz plz make me a small header file as an example so that i can modify it and add all my remaining functions .. thank you