C/string.h/strcpy — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
м (1 версия: Импорт контента...)
 
(нет различий)

Текущая версия на 10:22, 25 мая 2010

strcpy: copies *str2 into *str1. *str2 must be a pointer to a null-terminated string

    
 
//Declaration:  char *strcpy(char *str1, const char *str2); 
//Return:       returns a pointer to str1. 

#include<string.h>
#include<stdio.h>
int main(void){
  char str[80];
  strcpy(str, "hello");
  printf("%s", str);
}
         
        /*
hello*/