Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

String in pic16f877 and gsm

Status
Not open for further replies.

neelam29

New Member
Hi all
can anybody help me with an example on how to find the occurence of a string in another string.whether true or false type.

if i have a message " hello neelam29 do the coding ". is it possibel that the function finds whether 29 is present in this string and returns only TRUE OR FALSE not the number 29.

m using mplab as the compiler and pic16f877 as the controller with visiontek GSM modem.

thanks all
 
neelam29 said:
Hi all
can anybody help me with an example on how to find the occurence of a string in another string.whether true or false type.

if i have a message " hello neelam29 do the coding ". is it possibel that the function finds whether 29 is present in this string and returns only TRUE OR FALSE not the number 29.

m using mplab as the compiler and pic16f877 as the controller with visiontek GSM modem.

thanks all
First off, MPLab is not a compiler, it is an Integrated Development Environment, which provides an assembler. YOU must provide the compiler, and you haven't told us which compiler you have added to MPLab. Your problem, however, is with the C language, itself.

You really NEED to read through the book "The C Programming Language." By Brian W. Kernighan and Dennis M. Ritchie. (I cannot imagine anyone trying to learn this language without consulting this manual!) This is covered under ctype.h. You will find out how to use isdigit() and isalpha():

Chapter 7 - Input and Output

7.8.2 Character Class Testing and Conversion
Several functions from <ctype.h> perform character tests and conversions. In the following, c is
an int that can be represented as an unsigned char or EOF. The function returns int.
isalpha(c) non-zero if c is alphabetic, 0 if not
isupper(c) non-zero if c is upper case, 0 if not
islower(c) non-zero if c is lower case, 0 if not
isdigit(c) non-zero if c is digit, 0 if not
isalnum(c) non-zero if isalpha(c) or isdigit(c), 0 if not
isspace(c) non-zero if c is blank, tab, newline, return, formfeed, vertical tab
toupper(c) return c converted to upper case
tolower(c) return c converted to lower case
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top