Chinaunix首页 | 论坛 | 博客
  • 博客访问: 267475
  • 博文数量: 113
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1044
  • 用 户 组: 普通用户
  • 注册时间: 2015-02-15 16:09
文章分类

全部博文(113)

文章存档

2016年(5)

2015年(108)

我的朋友

分类: C/C++

2015-10-22 20:34:31

根据名字查找文件
find -name 20151001.c
typedef用法

点击(此处)折叠或打开

  1. struct list{
  2.     int age;
  3.     char *name;
  4.     char *grade;
  5. }
  6. typedef struct list LIST
malloc函数:
#include
#include
int main(){
char *p;
p=(char*)malloc(10);
if(p==NULL){
printf("malloc failed\n");
}
*p='A';
*(p+1)='B';
*(p+2)='C';
*(p+3)='\0';
printf("%s\n",p);
return 0;

}


struct 
#include
#include
struct student {
int grade;
char name[10];
};
int main(){
struct student stu;
stu.grade=10;
sprintf(stu.name,"%s","aaaa");
printf("%d,%s\n",stu.grade,stu.name);
return 0;
}
阅读(1735) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~