strcpy

#include <iostream>
#include <string.h>
struct book
  {
    char name[];
    int price;
    char act;
  }
  int main
  {
  struct book b1={ "C語言程序」 , 55, zhangjp};
  struct book* pb=&b1;
  //the result equal in value 「pb->name,pb->price etc"
  printf("書名叫: %s\n",b1.name);
  printf("價格是: %d\n",b1.price);
  printf("書的做者是: %s\n",b1.act);
  b1.price=65;
  printf("新的價格是:%s\n「,b1.price);
  strcpy(b1.name,c語言學習筆記);
  printf("新改的書名爲: %s\n", b1.price);
  
  
  return 0;
  }
相關文章
相關標籤/搜索