#include<stdio.h>
#include<string.h>
//#define MAX(X,Y) (X>Y?X:Y)
struct Book
{
char name[20];
int price;
};
int main()
{
//要想改变结构体数组里面的内容
//使用strcpy来改变
//结构体变量.成员
//结构体指针->成员
struct Book b1={"C语言程序设计",55};
strcpy(b1.name,"JAVA");
printf("%s\n",b1.name);
//printf("%s\n",b1.name);
//printf("%d\n",b1.price );
b1.price=15;
printf("%d\n",b1.price);
struct Book* pb=&b1;
printf("%d\n",(*pb).price);
printf("%d\n",pb->price);
printf("%s\n",pb->name);
// int a=10;
// int b=20;
// int c=MAX(a,b);
// printf("%d\n",c);
//在其他源文件定义的函数,如果想要在另一个源文件里面使用:
//需要在这个源文件中声明:extern int//返回值类型 函数名(int,int);
//static修饰局部变量
//局部变量的生命周期变长
//static修饰全局变量
//改变了变量的作用域,让静态的全局变量只可以在自己所在的源文件内部使用
//出了源文件就是用不了了
//static修饰函数
//static改变了函数的链接属性
//64位平台上指针的大小是8byte
32位平台上指针的大小是4byte
//由外部变为了内部
//char a='A';
//char* p=&a;
//printf("%d\n",sizeof(p));
return 0;
}