Pic Microproject
Pic Microproject
SUBMITTED BY :
1]SHRAVAN WAGH
2]VIKAS SARKATE
3]RUSHIKESH SURYAWANSHI
4] SARTHAK SHIRSATH
CERTIFICATE
This Is To Clarify That
1] SHRAVAN WAGH
2] VIKAS SARKATE
3] RUSHIKESH SURYAWANSHI
4] SARTHAK SHIRSATH
H.O.D
Prof.C.S.Kopare
INDEX
• INTRODUCTION
• APPLICATION
• ALGORITHM
• PROGRAM
• ADVANTAGES & DISADVANTAGES
• CONCLUSION
• REFERENCES
INTRODUCTION
String handling functions are operations in programming languages
that allow manipulation and management of strings (sequences of
characters). These functions provide a wide variety of methods to
search, modify, combine, or extract data from strings, making them
essential for tasks like text processing, data validation, and
communication with users.In most programming languages, strings
are considered objects or data types, and each language typically
provides a set of built-in functions to handle common string-related
operations. Here are some common types of string functions you
might encounter:"
APPLICATION
• Creating a C programming project that involves string
handling functions can be both an interesting and
educational exercise. Below, I'll guide you through creating a
basic string handling application that includes a set of
custom string functions, demonstrating various string
manipulation techniques.
ALGORITHM
• Algorithm1. substring function:-
• Check if start and end indices are valid. - Create a
new string to store the substring. - Copy characters
from start to end indices from str to the new string. -
Return the new string.
#include <stdio.h>
#include <string.h>
int main() {
// strlen()
// strcpy()
char dest[10];
strcpy(dest, str1);
// strcat()
strcat(dest, str2);
// strcmp()
// strchr()
// strrchr()
// strstr()
return 0;
}
• OUTPUT
Length of str1: 5
Copied string: Hello
Concatenated string: HelloWorld
Comparison result: -1
First occurrence of 'l': llo
Last occurrence of 'l': lo
First occurrence of 'll': llo
ADVANTAGE
ADVANTAGES AND DISADVANTAGES
ADVANTAGES DISADVANTAGES
1. Efficient Memory Use: String handling 1. Efficient Memory Use: String handling
functions in C allow for efficient memory functions in C allow for efficient memory
use by only allocating memory for the string use by only allocating memory for the string
when it is needed. when it is needed.
2. Flexibility: C string handling functions 2. Flexibility: C string handling functions
provide a range of functions for provide a range of functions for
manipulating strings, including manipulating strings, including
concatenation, comparison, and searching. concatenation, comparison, and searching.
3. Portability: C string handling functions 3. Portability: C string handling functions are
are widely supported and can be used on a widely supported and can be used on a
variety of platforms. variety of platforms.
4. Low-Level Memory Management: C 4. Low-Level Memory Management: C string
string handling functions provide low-level handling functions provide low-level
memory management, which can be useful memory management, which can be useful
for optimizing memory usage in certain for optimizing memory usage in certain
applications. applications.
5. Fast Execution: C string handling 5. Fast Execution: C string handling
functions are typically fast and efficient, functions are typically fast and efficient,
making them suitable for applications making them suitable for applications
where performance is critical.# where performance is critical.#
CONCLUSION
C string handling functions are a crucial part of the C
programming language, providing a range of functions for
manipulating and processing strings. These functions are
essential for many applications, including text processing, data
validation, and user input handling. While C string handling
functions can be error-prone and vulnerable to security risks if
not used correctly, following best practices such as bounds
checking, using safe functions, validating input, and utilizing
Unicode support can help developers write efficient, secure, and
reliable code. By mastering C string handling functions,
developers can create robust and effective applications that meet
the needs of their users.
REFERENCE
1.Books
2.The C Programming Language- Brian W.Kernighan & Dennis M.Ritchie
➢ https://www.geeksforgeeks.org/c-pointers/
➢https://www.programiz.com/c-programming/c-pointers
➢https://stackoverflow.com/questions/63318473/what does-the-
linker-actually-do-when-linking-a-pointer variable-to-an-array-in