Search
 
SCRIPT & CODE EXAMPLE
 

C

Combine two sentences into one langage c

#include <stdio.h>
#include <string.h>
void strcp(char *sender, int snder_size, char *reciever, int start_index)
{
    for (int x = 0; x < snder_size; x++)
    {
        reciever[start_index + x] = sender[x];
    }
}

char *addTwoStrings(char *str1, int str1_size, char *str2, int str2_size, char *reciever)
{
    strcp(str1, str1_size, reciever, 0); // 0 -> str1_size-1
    reciever[str1_size] = ' ';
    strcp(str2, str2_size, reciever, str1_size + 1); // str1_size+1 -> (str1_size + str2_size)-1
    return reciever;
}

int main()
{
		int  length1,  length2 , length3;
    char str1[1000];
    char str2[1000];
    char str3[2001];
    printf("Enter the first str : ");
    scanf("%s", str1);
		length1=strlen(str1);
    printf("Enter the second str : ");
    scanf("%s", str2);
	  length2=strlen(str2);
    addTwoStrings(str1, length1, str2, length2, str3);
    printf("the total string is :%s", str3);

  return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: delimter in c 
C :: convert calendar time to epoch in c programming 
C :: c program to pass a single element in an funtional array 
C :: BST or NOT ?? 
C :: pointer operator 
C :: #define _TIMESPEC_DEFINED struct timespec { time_t tv_sec; long tv_nsec; }; 
C :: code_art_bcm_10.c 
C :: set all pins as input for loop 
C :: deepak 
C :: YOUNG SEX PARTY underground collection 
C :: pebble scripting Boolean expression 
C :: python to java translator online 
C :: list fiter octobercms 
C :: determination data type in c 
C :: add last in list c 
C :: Odd-Even-inator with function in C 
C :: program to merge two strings in c 
C :: levenshtein c 
C :: debian9 remove pack 
C :: c text modifiers 
C :: c programming trinary if 
C :: array of pointers to functions 
C :: calendar in c 
Dart :: flutter appbar remove debug 
Dart :: flutter keyboard overflow when opens 
Dart :: flutter textfield outlineinputborder 
Dart :: scroll to top flutter 
Dart :: flutter portrait only 
Dart :: how to take integer input from user in dart 
Dart :: flutter flip image 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =