Function to copy one string to another without using strcpy() function


#include <stdio.h> 
#include <conio.h>
int main() 
{
void copyString(const char *src, char *dest); 
char str1[100]; 
char str2[100]; 
printf("Enter the string: "); 
gets(str1); 
copyString(str1, str2); 
printf("Copied string: %s\n", str2); 
getch(); 

void copyString(const char *src, char *dest) 
while (*dest++ = *src++); 

Comments

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System

Lambda two tables and three tables inner join code samples