Coding Stack AI 🤖
14.5K subscribers
152 photos
49 videos
161 files
277 links
Coding Stack

🌀 Learn Coding from scratches

✍️ Unique Contents✍️

🧑‍💻 Free PDF & Notes to learn everything 🤓

📍Admin :

🔸LinkedIn (150k+) : https://www.linkedin.com/in/tulsisoni

🔸Twitter (20k+) : https://twitter.com/shedntcare_
Download Telegram
142. Program to concatenate two strings using pointer.

#include <stdio.h>

void concatenator(char *str, char *substr) {

while (*str)
str++;

while (*substr) {
*str = *substr;
substr++;
str++;
}

*str = '\0';
}

int main() {

char str[100], substr[100];

printf("Enter the source string : ");
gets(str);

printf("\nEnter string to concatenate : ");
gets(substr);

concatenator(str, substr);

printf("String after concatenation is \"%s\"\n", str);

return 0;
}
telegram.me/Codingstack
👍53🎉2🤩2😱1