Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

program for comparing 2 strings without strcmp()

Answer Posted / ankitecian

int StrCmp(const char *_input1, const char *_input2)
{
int _cntr1 = 0;
int _flg = 0;
while(*(_input1 + _cntr1) != NULL || *(_input2 + _cntr1) !
= NULL)
{
if(*(_input1 + _cntr1) != *(_input2 + _cntr1))
{
_flg = -1;
}
_cntr1++;
}
return _flg;
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you increase the size of a statically allocated array?

1081


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2693


Is javascript based on c?

1073


Simplify the program segment if X = B then C ← true else C ← false

3021


What is identifiers in c with examples?

1184


Why doesnt this code work?

1069


What are the types of pointers?

1119


Write a program to show the change in position of a cursor using c

1072


What is the use of pragma in embedded c?

1063


What is #ifdef ? What is its application?

1112


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1249


Explain what are linked list?

1047


What are structure members?

1094


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1078


What is unsigned int in c?

1007