Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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 :
C#
#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]!='\0')


            if(a[i]==c)
            {
                j=2;
            }
            if(j==2)
            {
                f[k]=a[i];
                k++;
            }
        }

            f[k]='\0';

                return f;



}

XML
#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;
}

XML
#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
Posted
Updated 21-Feb-13 9:52am
v2
Comments
Sergey Alexandrovich Kryukov 21-Feb-13 15:41pm    
Not a question.
—SA
jahanxb 21-Feb-13 15:42pm    
well sir it's a also a question that how can i make my own header file and in the files their is also notok folder which has my header file , that has errors :(
joshrduncan2012 21-Feb-13 16:02pm    
I agree with SA. This is not a question. We do not take orders from people. We will, however, help you with any issues you might be having if you show us where the issues are in your code with detailed error messages.
[no name] 21-Feb-13 17:56pm    
So your "question" boils down to "How do I create a header file?"
CHill60 21-Feb-13 18:37pm    
I'm with SA on this ... not a question. And please please PLEASE... stop with "text speak"... u = You; plz = please; frndz = friends (I think!) - @SA ... not often we agree hey .. but on these occasions :-). @OP To create your own header file open NotePad.exe, type in your requirements, save the file as SomeMeaningfulNameToYou.h in your project folder

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900