How to write a C Program To Copy One Character Array Into Another in C Programming Language ?
Solution For C Program :
#include<stdio.h>
void main()
{
char str1[81], str2[81];
int k = 0;
printf("\nEnter Any Data : ");
scanf("%s", str1);
printf ("\nProcessing The String : ");
for (k = 0; str1[k] != '\0'; k++)
str2[k] = str1[k];
str2[k] = '\0' ;
printf ("\nThe Two Stings Are :\n%s \t %s", str1, str2);
}
You may also learn these C Program/Code :
C Program To Swap Two Numbers Without Using Third Variable
Learn More :
Characters
- C Program Character toupper() Example
- C Program Character Example
- C Program To Print Lines Of A Paragraph Having More Than 15 Characters
- C Program to Print ASCII equivalent of a character until terminated by key is ‘x’
- C Program to find the number of unique characters
- Printing ASCII Table with Numbers and corresponding characters
- C Program to Compare Two Character
- Design a C function that shortens a string to 8 characters
- Menu driven program in C which performs the following operations on strings
- File Handling (console to file) in C Program
Array
- How to pass one dimensional array to function in c.
- Write a c program which passes two dimension array to function.
- C Program Array Index Example
- C Program Array Example: Average
- C Program Array Example: Reverse
- C Program Array Example
- C Program to Array
- C Program Array NxM Elements Geometric/Arithmetic
- C Program To Find The Maximum And Minimum Value In An Array
- C Program To Find Union & Intersection Of Two Array
- C Program To Search A Number Inside The Array
- C Program To Sort An Array In Ascending And Descending Order
- C Program To Sort An Array Of Names In Alphabetical And Reverse Order
- Returns: array of decoded values. [0] - count of values
- C Program to Check if a number is in an array[1000]
- C Program to Find max and min in array using pointer concept
- C Program Sort Array By Segment
- C Program to sort an array using bubble sort
- C Program to find smallest in an array using pointer
- C Program to merge and sort two arrays
- Un-sortiertes Array and Sortiertes Array
- C Program to Array Deserialization
- C program calculates a given function in range given by user, stores the data in arrays and displays the answer in a table.
- Input reads in the array positions and range for random generation.
Copy
- COPY DATA FROM ONE FILE TO ANOTHER FILE USING C PROGRAM
- C Program/Code to Copies a BMP piece by piece
- Make a copy of file given in argv[1] to file given in argv[2]
- C Program to copy a file to another file
- A small I/O bound program to copy N bytes from an input file to an output file.
- C Program to Create a copy of an image
- C Program Copies a BMP piece by piece
- Menu driven program in C to Calculate Length, Copy into Another Compare Concatenate of Two String