answersLogoWhite

0

Example1:

sprintf (to, "%s%", from1, from2);

Example2:

size_t len1= strlen (from1);

memcpy (to, from1, len1);

strcpy (to+len1, from2);

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Concatenate two files without using strcat function?

Win/Dos: copy file1+file2 tofile unix: cat file1 file2 >tofile


To copy two strings using strcpy?

Using strcpy and strcat. Or sprintf. Or strlen+memcpy. There are more than solutions.


C program to concatenate without using strcat?

#include#include#includevoid main(){char str1[30],str2[30];int l1,l2,i;clrscr();gets(str1);gets(str2);l1=strlen(str1);l2=strlen(str2);for(i=0;i


Write a c program to copy the string without using strcpy?

use strcat, strncpy, stpcpy, sprintf, strlen+memcpy, etc


How do you write the concatenate the strings using pointer?

char* strcat (char* destination, const char* source) { char* return_value = destination; // temp destination for return while (*(destination++) != '\0'); // find end of initial destination while ((*(destination++) = *(source++)) != '\0'); // copy source to end of destination return return_value; // return original value of destination }


C prog to concatenate two string without using buid in function?

//String Concatination#include#includeusing namespace std;char* strcat(char*,char*);int main(){char str1[100];char str2[100];coutstr1;coutstr2;cout


How do you concatenate a string?

v can concatenate two string by using a function like: select CONCAT( CONCAT('ename','e_mrks'),"name","marks" from student;


How do you concatenate text in Microsoft Excel?

You can concatenate using the & operator. So say you have a firstname of a person in cell B2 and their surname in cell C2 and in D2 you want to display their first name, a space and their surname together, you would do this: =B2 & " " & C2 You could also use the CONCATENATE function to do the same thing: =CONCATENATE(B2," ",C2)


What are the advantages of using string?

Using strings in programming offers several advantages, including ease of manipulation and readability. Strings allow for straightforward representation of text data, making it simple to display, edit, and concatenate text. They also support various built-in functions for searching, formatting, and transforming text, enhancing efficiency in handling textual information. Additionally, strings are widely supported across programming languages, promoting portability and ease of integration.


How do you add text together in Excel cell?

You can concatenate text either using the CONCATENATE function or the & operator. If you had text in cell A2 and cell B2 that you wanted to add together in another cell you could do it in either of these ways: =A2 & B2 =CONCATENATE(A2,B2)


String handling function in c?

In C, string handling functions are primarily found in the <string.h> library, which provides various utilities for manipulating strings. Common functions include strlen() for determining the length of a string, strcpy() for copying one string to another, strcat() for concatenating two strings, and strcmp() for comparing two strings. These functions operate on null-terminated character arrays, which are the standard way to represent strings in C. Proper memory management is essential when using these functions to avoid buffer overflows and undefined behavior.


Is it possibly to return an array of strings in a function without using pointers in C plus plus?

No.