0% found this document useful (0 votes)
62 views

Programs Without Using String Functions

This document contains code snippets for programs that perform common string operations like finding length, copying, reversing, concatenating, and converting case without using built-in string functions. It includes a program that uses a for loop to find the length of a string by iterating until it reaches the null terminator. Another program copies characters from one string to another index by index until reaching the end. A third program reverses a string by copying the last index of one string to the first of another.

Uploaded by

Satoru Fujinuma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Programs Without Using String Functions

This document contains code snippets for programs that perform common string operations like finding length, copying, reversing, concatenating, and converting case without using built-in string functions. It includes a program that uses a for loop to find the length of a string by iterating until it reaches the null terminator. Another program copies characters from one string to another index by index until reaching the end. A third program reverses a string by copying the last index of one string to the first of another.

Uploaded by

Satoru Fujinuma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

UNIT

3 STRINGS

IT 105 Computer Programming 2


Programs without using String Functions

IT 105 Computer Programming 2


Program to find length of string without using strlen()

The loop will continue until the


end of string marker is found (‘\0’)

IT 105 Computer Programming 2


Program to copy string without using strcpy()

copying the content index by index until the


end of string

placing the end of string marker

IT 105 Computer Programming 2


Program to reverse string without using strrev()

Finding the length of string using for-loop,


The length is used to determine the last index
of str1

Copying the content of str1 to str2 index by


index
Variable i will start at the last index of str1
based on its length while variable j will start at
0

IT 105 Computer Programming 2


Program to concatenate two strings without using strcat()

IT 105 Computer Programming 2


Program to convert string to lowercase or uppercase without using
strlwr() and strupr

IT 105 Computer Programming 2

You might also like