Search
 
SCRIPT & CODE EXAMPLE
 

C

C Program to Concat Two Strings without Using Library Function

#include<stdio.h>
#include<string.h>
void concat(char[], char[]);
int main() {
	char s1[50], s2[30];
	printf("
Enter String 1 :");
	gets(s1);
	printf("
Enter String 2 :");
	gets(s2);
	concat(s1, s2); //call the function
	printf("
Concated string is :%s", s1);
	return (0);
}
//function to concatiate two string s1 and s2
void concat(char s1[], char s2[]) {
	int i, j;
	i = strlen(s1);
	for (j = 0; s2[j] != ''; i++, j++) {
		s1[i] = s2[j];
	}
	s1[i] = '';
}
Comment

c concatenate strings

char str[80];
strcpy(str, "these ");
strcat(str, "strings ");
strcat(str, "are ");
strcat(str, "concatenated.");
Comment

how to combine strings in c

#include <stdio.h>
#include <string.h>
int main() {
	char str[80];
strcpy(str, "these ");
strcat(str, "strings ");
strcat(str, "are ");
strcat(str, "concatenated.");
printf("%s
", str);
}
Comment

concate string in c

#define TESTING opa
Comment

PREVIOUS NEXT
Code Example
C :: Print fabionci with fork in C 
C :: escaping characters in hibernate queries 
C :: laarvel artisan to create controller model miigration 
C :: Uri/Beecrowd problem no - 1149 solution in C 
C :: why return 0 is written at the code end? 
C :: string compare in c 
C :: how to turn off bash 
C :: how to use arry 
C :: online c compiler with mpi 
C :: class to const void * 
C :: how to get a string input in c 
C :: c printf float value 
C :: vs code turn off formatter 
C :: time now C 
C :: c local variable 
Dart :: flutter keyboard causes overflow 
Dart :: flutter elevated button radius 
Dart :: flutter label align top 
Dart :: flutter text hint 
Dart :: height appbar flutter 
Dart :: constrainedbox flutter 
Dart :: borderradius.only flutter 
Dart :: how to take integer input from user in dart 
Dart :: flutter snackbar margin 
Dart :: dart read from terminal 
Dart :: flutter iconbutton 
Dart :: convert long to date android 
Dart :: dart super constructor 
Dart :: flutter flat button size 
Dart :: flutter add text on image 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =