Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

concatenate two strings without standard library in C

#include<stdio.h>

void main(void)
{
  char str1[25],str2[25];
  int i=0,j=0;
  printf("
Enter First String:");
  gets(str1);
  printf("
Enter Second String:");
  gets(str2);
  while(str1[i]!='')
  i++;
  while(str2[j]!='')
  {
    str1[i]=str2[j];
    j++;
    i++;
  }
  str1[i]='';
  printf("
Concatenated String is %s",str1);
}
Explanation:
Source by www.w3schools.in #
 
PREVIOUS NEXT
Tagged: #concatenate #strings #standard #library #C
ADD COMMENT
Topic
Name
9+6 =