Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 19-02-2008, 01:48 PM   #1 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default how to make the string function ?


hello ,

I KNOW what is string.h and all it's function........(strrev,strcpy,strlen.and all )but how to make their own defined functions...how to pass the value to programme ..................[THAT SELF MADE FUNCTION.........THAT WE DEFINE BEFORE MAIN() FUNCTION.]
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 20-02-2008, 10:05 AM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2007
Posts: 16
Default Re: how to make the string function ?

#include<stdio.h>
#include<conio.h>
int strlent(char *a)
{
int i;
for(i=0;a[i]!='\0';i++);
return i;
}
void main()
{
char a[100];
clrscr();
printf("\n\n\t\tEnter the string = ");
fflush(stdin);
gets(a);
printf("\n\n\t\t The length of the string is = %d",strlent(a));
getch();
}

The above is the function for computing string length. Try next two by yourself. Keep asking...
__________________
Always try to do better than the best.......
manubatham20 is offline  
Old 20-02-2008, 12:55 PM   #3 (permalink)
Alpha Geek
 
Join Date: Feb 2005
Posts: 959
Default Re: how to make the string function ?

alternatively and more advantageously, you can also construct your own custom header file with definitions and declarations in a C file and include that header file. (not for already built in functions like these, but other functions like say, computing integration or differential equations solution or bessel functions or as in ur case, custom string operations that doesn't exist in the package)
__________________
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
legolas is offline  
Old 25-02-2008, 09:43 PM   #4 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: how to make the string function ?

@manubatham20

thanx for it, really sorry for late reply but was very busy............in that (strlent function) numeric value was returned from function how to pass a string from function.....means make a function to get reverse string (strrev)......

can anyone help me ?

I have a problem in that only how to return a value ,means in that u return value of I and printout 'a'................so how it happened.........
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to extract the needed part from a string in vb.net *GandaBerunda* Programming 3 05-11-2007 01:05 PM
PC function citizen Software Q&A 5 09-12-2006 11:55 PM
Help with the IF Function in Excel h1ghn3zz Software Q&A 3 22-08-2006 09:36 AM
cant declare a string variable... geekgod Open Source 13 12-08-2006 06:09 AM
asp 'replace' string query! 144 QnA (read only) 1 30-06-2006 10:35 AM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2