strcpy



defined in header file string.h

char * strcpy( char * destination, const char * source);

The strcpy() function copies the string pointed by source (including the null) to the destination pointer.


Parameters

Parameter NameDescription
destinationThe Pointer to the destination
sourceThe Pointer to the source
Returns

pointer to the destination.


Example Code:
#include <stdio.h>
#include <string.h>

int main ( int argc, char* argv[]) 
{
	char source_str[] = "Test Message";
	char dest_str[100];
	memset( dest_str, 0, sizeof(dest_str));
	
	strcpy( dest_str, source_str);
	
	printf("%s\n", dest_str);
	
	return EXIT_SUCCESS;
}


Program Output:



strtok

Split string into tokens

posted on 2019-03-17 20:41:48 - C Programming Language Tutorials


zalloc

zalloc is a third party library

posted on 2018-12-12 20:46:30 - C Programming Language Tutorials


math

posted on 2017-12-29 22:52:47 - C Programming Language Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials