JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: C Language in hindi

String : Functions in c computer language definition in hindi स्ट्रिंग क्या है c भाषा में कंप्यूटर हिंदी में

स्ट्रिंग फंक्शन क्या है c भाषा में कंप्यूटर हिंदी में String : Functions in c computer language definition in hindi :-
C programe  मे character पर भी integer के तरह operation perform हो सकता है |जब कभी किसी expression मे character का use होता है तब system के द्वारा ये character स्वत ही integer मे change हो जाता है |सभी character की fixed ASIIC value होती है |
किसी character को integer मे चगे करने के लिए प्रोग्राम है |
#include<conio.h>
#include<stdio.h>
void main()
{
char a=’b’;
printf(“Asiic value of b is %d”,a);
getch();
}आउटपुट होगा :
Asiic value of b is 98किसी character  पर arithmetic operation भी perform कर सकते है | Arithmetic operation मे character  की ASIIC value के साथ कैलकुलेशन होती है |जैसे :#include<conio.h>
#include<stdio.h>
void main()
{
char a=’b’;
char y;
y=’a’+1;
printf(“Asiic value of b is %d”,a);
printf(“%c”,y)
printf(“Asiic value of b is %d”,y);
getch();
}
इस उदहारण मे , b की ASIIC value 98 है, y=’a’+1; statement से y की  ASIIC value 98+1=99 हो जाएगी |printf(“%c”,y) से 99 ASIIC value वाला character print होगा |
आउटपुट होगा :
Asiic value of b is 98
c
Asiic value of b is 99

1.atoi() function

इस function से किसी digits के string को integer को convert कर सकते है |जैसे
#include<conio.h>
#include<stdio.h>
void main()
{
char a=’2019′;
int b;
b=atoi(a);
printf(“%d”,b);
getch();
}
इस उदाहारण मे ‘2019’ जो की एक string है b=atoi(a); statement से integer मे convert हो गयी जो की integer variable b मे store हो जाती है |
ओउपुत होगा :
2019

String Comparison :

किसी दो Strings को compare करने के लिए string.h header file मे ,strcmp() function होता है |इस function की value ‘0’ होती है जब दोनों string match हो जाती है | और ‘1’ तब होती है जब दोनों strings match नहीं होती है|
इसका syntax है :-
strcmp(string_name 1,string_name 2);
उदहारण के लिए :
#include<conio.h>
#include<stdio.h>
void main()
{
char a[10],b[10];
int i;
printf(“enter your string 1”);
gets(a);
printf(“enter your string 2”);
gets(b);
if(strcmp(a,b)==1)
{
printf(“Strings are not same .”);
}
else
{printf(“Strings are same .”);
}

getch();
}

आउटपुट होगा :
enter your string 1 ParthPatel
enter your string 2 ParthPatel
Strings are same .
और
enter your string 1 PriyaPatel
enter your string 2 ParthPatel
Strings are not same .
String cascading:
String cascading का मतलब है दो strings को जोड़ना |इसके लिए string.h header file मे ,strcat() function होता है |इसका syntax है :-
strcat(string_name 1,string_name 2);

string_name 1,string_name 2 दो charter array होती है |जब strcat () function execute होगा string_name 2 ,string_name 1 के बाद write होगा |string_name 1 मे null charter को डिलीट करके string_name 2 को insert किया जाता है |
और  string_name 1 की size इतनी होनी चाहिए की string_name 2 के chartercet insert हो जाये |
उदहारण के लिए :

#include<conio.h>
#include<stdio.h>
void main()
{
char a[15],b[10];
printf(“enter your string 1”);
gets(a);
printf(“enter your string 2”);
gets(b);
strcat(a,b);
printf(“%s”,a);
getch(();
}

आउटपुट होगा :

enter your string 1 Parth
enter your string 2 Patel
ParthPatel

इस function से दो strings को ही नहीं string constant को भी add कर सकते है |उदाहरण के लिए:
#include<conio.h>
#include<stdio.h>
void main()
{
char a[15],b[10];
printf(“enter your string 1”);
gets(a);
strcat(a,Hello!);
printf(“%s”,a);
getch(();
}
ओउपुत होगा :
enter your string 1 Parth
ParthHello!

String Copy :

String copy function strcpy() का use किसी string को दुसरे string मे copy करने के लिए किया जाता है |इसका syntax है :-

strcpy(string_name 1,string_name 2);

और  string_name 1 की size इतनी होनी चाहिए की string_name 2 के charterer,string_name 1 मे copy हो जाये |उदहारण के लिए:
#include<conio.h>
#include<stdio.h>
void main()
{
char a[15],b[10];
printf(“enter your string 1”);
gets(a);
printf(“Before Coping=%s”,a);
printf(“enter your string 2”);
gets(b);
strcpy(a,b);
printf(“After Coping=%s”,a);
getch(();
}
आउटपुट होगा :

enter your string 1 Parth
enter your string 2 Patel
Before Coping=Parth
After Coping=Patel

String Length:

Strlen() का उपयोग string की length (Number of character )को calculate करनेके  लिए  किया जाता है |इसका syntax है :-
Strlen(string_name);
उदहारण के लिए :
#include<conio.h>
#include<stdio.h>
void main()
{
char a[15];
printf(“enter your string “);
gets(a);
int length;
length=strlen(a);
printf(“Size of string=%d”,length);
getch();
}आउटपुट होगा :
enter your string Parth
Size of string=5इसके next article मे इस अभी function को for loop और pre define function के अलावा प्रोग्राम को discuss करेगे |
Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

11 hours ago

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

3 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

5 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

1 week ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

1 week ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now