2

C Program to append a character to a string

 1 year ago
source link: https://www.geeksforgeeks.org/videos/c-program-to-append-a-character-to-a-string/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

C Program to append a character to a string

C Program to append a character to a string
Hello friends. Welcome back to Geeks for weeks.
  • 40 Views
  • 23/08/2022

In this video, we will write a C program to append a character to a String

Here we see one method for string concatenation: 
1. Using strcat() 

Examples: 
Input String 1: GEEK 
Input Character Ch: S 
Output String: GEEKS 

Input String 1 : Welcome to 
Input Character ch: C 
Output : Welcome to C 

Using strcat(): In C, strcat() is a predefined function used for string handling, under string library (string.h in C). This function appends the string pointed to by src to the end of the string pointed to by dest. A copy of source string will be appended in the destination string plus a terminating Null character. 

The initial character of the string(src) overwrites the Null-character present at the end of the string(dest).

How to Append a Character to a String in C
https://www.geeksforgeeks.org/how-to-append-a-character-to-a-string-in-c/


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK