📄 cmp.c
字号:
#include<stdlib.h>#include<stdio.h>#include<string.h>int main(){ char *buf=malloc( 10 ); int i;// strcpy(buf,"hello"); buf="hello"; for(i=0;i<7;i++){ printf("%d ",*(buf+i) ); } printf( "%s\n" , buf ); printf( "%x\n" , buf ); char *newbuf;/* newbuf=realloc( buf , 20 ); printf("here\n"); printf("new:%x old:%x\n",newbuf,buf); printf("here\n"); if(newbuf==NULL){ perror("realloc\n"); } strcpy(newbuf , "hello world\n" ); printf("here\n"); printf( "%s" ,newbuf );*/ exit(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -