answersLogoWhite

0

Function. Use the built-in help for details.

User Avatar

Wiki User

11y ago

What else can I help you with?

Continue Learning about Engineering

What is the correct call to the library function strcat?

strcat (into, from); correct. into (strcat, from); incorrect. strcat (from, from); incorrect. ....


What is concatenate function in c?

strcat


Why strcat(string'!') not work in C program?

The strcat() function has the following protocol:char* strcat (char* destination, char* source);The function appends the source string to the destination string and returns the destination string.The destination string must be a null-terminated character array of sufficient length to accommodate strlen (source) plus strlen (destination) characters, plus a null-terminator. The existing null-terminator and subsequent characters of destination are overwritten by characters from the source string, up to and including the source string's null-terminator.strcat (string, '!') will not work because '!' is a character literal (ASCII code 33 decimal), not a null-terminated character array. Use "!" instead of '!'.Example:char string[80]; // character arraystrcpy (string, "Hello world");strcat (string, "!");puts (string);


What symbol is use to join strings?

Language dependent. In C, for example, there no string as such, but you can use function strcat to concatenate zero-terminated character-sequences.


Character stuffing in C?

#include #include main() { char a[30],fs[50]="",t[3],sd,ed,x[3],s[3],d[3],y[3]; int i,j,p=0,q=0; clrscr(); printf("Enter characters to be stuffed : "); scanf("%s",a); printf("\nEnter a character that represents starting delimiter : "); scanf(" %c",&sd); printf("\nEnter a character that represents ending delimiter : "); scanf(" %c",&ed); x[0]=s[0]=s[1]=sd; x[1]=s[2]='\0'; y[0]=d[0]=d[1]=ed; d[2]=y[1]='\0'; strcat(fs,x); for(i=0;i { t[0]=a[i]; t[1]='\0'; if(t[0]==sd) strcat(fs,s); else if(t[0]==ed) strcat(fs,d); else strcat(fs,t); } strcat(fs,y); printf("\nAfter stuffing : %s",fs); getch(); }

Related Questions

What is the correct call to the library function strcat?

strcat (into, from); correct. into (strcat, from); incorrect. strcat (from, from); incorrect. ....


Random sentence generator in c plus plus?

#include <stdio.h> #include <stdlib.h> const char *noun[]={"boy", "girl", "dog", "town", "car"}; const char *verb[]={"drove", "jumped", "ran", "walked", "skipped"}; const char *preposition[]={"to", "from", "under", "over", "on"}; const char *article[]={"the", "a", "one", "some", "any"}; char sentence[50]; int main(void) { strcat(sentence, *(article+(rand() %5))); strcat(sentence, " "); strcat(sentence, *(noun+(rand() %5))); strcat(sentence, " "); strcat(sentence, *(verb+(rand() %5))); strcat(sentence, " "); strcat(sentence, *(preposition+(rand() %5))); strcat(sentence, " "); strcat(sentence, *(article+(rand() %5))); strcat(sentence, " "); strcat(sentence, *(noun+(rand() %5))); printf("%s",sentence); getch(); return 0; }


How do you concatenate strings in C programming?

strcat if u wnt to use strcat then include string.h header file


What is concatenate function in c?

strcat


Which function joins one string with another to produce single string that contains both?

strcat()


To copy two strings using strcpy?

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


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

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


Why strcat(string'!') not work in C program?

The strcat() function has the following protocol:char* strcat (char* destination, char* source);The function appends the source string to the destination string and returns the destination string.The destination string must be a null-terminated character array of sufficient length to accommodate strlen (source) plus strlen (destination) characters, plus a null-terminator. The existing null-terminator and subsequent characters of destination are overwritten by characters from the source string, up to and including the source string's null-terminator.strcat (string, '!') will not work because '!' is a character literal (ASCII code 33 decimal), not a null-terminated character array. Use "!" instead of '!'.Example:char string[80]; // character arraystrcpy (string, "Hello world");strcat (string, "!");puts (string);


What symbol is use to join strings?

Language dependent. In C, for example, there no string as such, but you can use function strcat to concatenate zero-terminated character-sequences.


Character stuffing in C?

#include #include main() { char a[30],fs[50]="",t[3],sd,ed,x[3],s[3],d[3],y[3]; int i,j,p=0,q=0; clrscr(); printf("Enter characters to be stuffed : "); scanf("%s",a); printf("\nEnter a character that represents starting delimiter : "); scanf(" %c",&sd); printf("\nEnter a character that represents ending delimiter : "); scanf(" %c",&ed); x[0]=s[0]=s[1]=sd; x[1]=s[2]='\0'; y[0]=d[0]=d[1]=ed; d[2]=y[1]='\0'; strcat(fs,x); for(i=0;i { t[0]=a[i]; t[1]='\0'; if(t[0]==sd) strcat(fs,s); else if(t[0]==ed) strcat(fs,d); else strcat(fs,t); } strcat(fs,y); printf("\nAfter stuffing : %s",fs); getch(); }


Write a program in C to concatenante 2 strings?

Here is very small application written in C, that concatenates strings.#include #include int main() {char str[100];strcpy(str, "Hello ");strcat(str, "World!");printf("%s\n", str);return 0;}The result is "Hello World!".Concatenation is done by function strcat which is defined in string.h.


Concatenate two files without using strcat function?

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